Could not load file or assembly 'Microsoft.Vis

2019-01-21 15:42发布

Could not load file or assembly 'Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.


Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\11.0\WebDev.WebServer40.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = TTLWIN2K\miralp
LOG: DisplayName = Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
LOG: Appbase = file:///C:/SVN/temp/components/src/MasterpassProxy/src/Webservice/
LOG: Initial PrivatePath = C:\SVN\temp\components\src\MasterpassProxy\src\Webservice\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\SVN\temp\components\src\MasterpassProxy\src\Webservice\web.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

10条回答
手持菜刀,她持情操
2楼-- · 2019-01-21 16:25

Had a similar problem (another assembly) and for me it was a missing line in the web.config on the machine. A line that I think lets the web server load (any?) dll. I had to add "*" to the compilation-assemblies list in the web.config:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config

Like this

    <compilation>
      <assemblies>
        ...
        <add assembly="*" />
      </assemblies>
    </compilation>

To find it I had to compare the file with one from a working server. So it seems to me that It really is a load failure, but to determine why it fails, we need to be Sherlook H.. Normally I use a tool like ProcessMonitor to find out why I get a Load Failure, but this time, of course, it gave me no useful output.. IIS never tried to load the assembly!

查看更多
祖国的老花朵
3楼-- · 2019-01-21 16:27

I removed the dll from gac and it started working. I am not sure where those dlls came from. If you have 2 or more versions of visual studio, reinstall the last version.

查看更多
做个烂人
4楼-- · 2019-01-21 16:28

If you don't see web.config in both of paths: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config

file "Web" is in "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\" what I really want to show you, It's Web.config, you should open it with: notepad++... and remove:

//" I finish my problem with them.

查看更多
啃猪蹄的小仙女
5楼-- · 2019-01-21 16:29

I got the same problem but not on my development machine but on hosting server.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config

I was able to fix it by adding below code to my web.config

<compilation targetFramework="4.5"> 
    <assemblies> 
        <remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </assemblies> 
</compilation>

or by removing reference to this assembly from web.config files in framework directories.

I never installed VS there and i never had PageInspector installed there. Any idea why those configs reference them?

查看更多
登录 后发表回答