无法加载文件或程序集'Microsoft.VisualStudio.Web.PageInspector.Loader

Mir*_*ral 81 visual-studio page-inspector

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

Dav*_*vid 175

我遇到了同样的问题,罪魁祸首是我卸载了Visual Studio Express 2012.(可能是它可能是VS2012的任何版本.)我的整体操作顺序是:

  • 安装Visual Studio Express 2012(很久以前)
  • 使用Visual Studio Express 2012很开心很多个月
  • 安装了Visual Studio 2013 Premium
  • 几周使用Visual Studio 2013 Premium
  • 卸载Visual Studio Express 2012
  • 错误

我不是100%肯定它的原因,或者VS 2012/2013的哪些组合会表现出这种行为.但对我来说,解决方案是编辑web.config框架目录中的根文件:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config
Run Code Online (Sandbox Code Playgroud)

并删除行:

<remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Run Code Online (Sandbox Code Playgroud)

这解决了我的问题.

  • 你的答案是对的.突然发生错误的原因是卸载VS2012将删除程序集"Microsoft.VisualStudio.Web.PageInspector.Loader"并且.NET Framework的`web.config`仍然引用它 - 即使它只是说"不要使用这个程序集"(ref:`<remove />`标签)!!! 注意:根据您所针对的.NET版本(2.0,3.5,4.0和32/64位),您可能需要编辑`C:\ Windows\Microsoft.NET\Framework下的许多web.config文件[ 64]\[版本]\Config \`路径. (10认同)
  • @wiero:我.与VS 2017社区并排安装VS 2019预览后发生的事情.FWIW,解决方案是从`C:\ Windows\Microsoft.NET中删除行`<add assembly ="Microsoft.VisualStudio.Web.PageInspector.Loader,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a"/>` \框架\ v4.0.30319\CONFIG\web.config` (5认同)
  • 我卸载VS 2015社区预览后得到了这个,它也适用于我. (4认同)
  • 卸载2013 Express后出现此错误.你的解决方案对我有用. (2认同)
  • 我也有这个错误 - 安装和卸载VS2013 Pro VS2013 Pro; 不幸的是,修复VS2015 Pro设置并没有解决问题 (2认同)
  • 在Visual Studio 2019中,结束的&lt;/ assemblies&gt;标签与PageInspector引用位于同一行。**确保您不会意外删除它**,在删除参考之前将其移至下一行! (2认同)

use*_*795 18

无需删除这些行
只需关闭并使用Admin权限重新打开Visual Studio .

  • 我一直在管理模式下运行Visual Studio,但仍然无法正常工作。按照大卫/迈克的建议删除这些行就可以了。 (3认同)

Paw*_*wel 14

我遇到了同样的问题,但不是在我的开发机器上,而是在托管服务器上.

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

我能够通过在我的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>
Run Code Online (Sandbox Code Playgroud)

或者从框架目录中的web.config文件中删除对此程序集的引用.

我从来没有在那里安装VS,我从来没有安装过PageInspector.知道为什么那些配置会引用它们吗?

  • 安装VS 2019 Preview之后,我开始出现此错误,并且此解决方案对我有用。 (2认同)

Ber*_*ken 5

更新:根据此页面在Visual Studio 2019版本16.0.3中进行了修复。

如果在升级到Visual Studio 2019 RC之后发生这种情况,以下解决方法将有所帮助:

  1. 查找下载缓存目录 在此处输入图片说明
  2. 使用资源管理器或更高版本在此目录中找到AspNetDiagnosticPack.msi。
  3. 运行(双击)AspNetDiagnosticPack.msi文件(这将强制安装此MSI)。

解决方法在这里