FileNotFound试图加载"Microsoft.VisualStudio.Web.PageInspector.Runtime"的v14.0.0.0

Zee*_*e18 29 asp.net-mvc page-inspector visual-studio-2013

我有一个MVC项目一直工作,直到我一周前更新我的机器.我现在在尝试运行项目时收到绑定错误

托管调试助手'BindingFailure'在'C:\ Program Files(x86)\ IIS Express\iisexpress.exe'中检测到问题.

附加信息:显示名称为"Microsoft.VisualStudio.Web.PageInspector.Runtime"的程序集无法加载到ID为2的AppDomain的"LoadFrom"绑定上下文中.失败的原因是:System.IO.FileNotFoundException:Could不加载文件或程序集'Microsoft.VisualStudio.Web.PageInspector.Runtime,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一.该系统找不到指定的文件.

如果我继续错误,项目会正确加载.然而,当我运行该项目作为一个云服务网络的作用,它不会运行,因为它不断弹出与作用于预期....消息需要较长时间

我假设这与作为独立项目运行时的绑定问题有关

有没有人遇到过这个?


编辑我在配置文件中搜索程序集引用,没有出现任何问题.最后我刚刚重新安装了新的azure SDK.带有pageinspector的绑定错误消息仍会在加载时弹出,但如果我继续该项目,它可以正常工作.目前,我将不得不忍受这个恼人的消息,直到找到解决方案

Sha*_*son 28

我已经在安装了Visual Studio 2013的计算机上发现了这种情况.

在VS2013更新4之后,我开始发生这种情况.

(它可能以前发生过,但这对我的环境来说是新的)

我将这个程序集放在GAC中(两个版本,一个用于VS2012,另一个用于VS2013)但是这些版本很强(很明显)命名为"12.3.0.0"(注意上面的分辨率错误是针对某个版本的) 14"组装.)

以下是此特定异常的第一个实例的调用堆栈:

mscorlib.dll!System.Reflection.RuntimeAssembly.nLoad(System.Reflection.AssemblyName fileName, string codeBase, System.Security.Policy.Evidence assemblySecurity, System.Reflection.RuntimeAssembly locationHint, ref System.Threading.StackCrawlMark stackMark, System.IntPtr pPrivHostBinder, bool throwOnFileNotFound, bool forIntrospection, bool suppressSecurityChecks) + 0x23 bytes   
mscorlib.dll!System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity, System.Reflection.RuntimeAssembly reqAssembly, ref System.Threading.StackCrawlMark stackMark, System.IntPtr pPrivHostBinder, bool throwOnFileNotFound, bool forIntrospection, bool suppressSecurityChecks) + 0x99 bytes   
mscorlib.dll!System.Reflection.Assembly.Load(System.Reflection.AssemblyName assemblyRef) + 0x25 bytes   
Microsoft.VisualStudio.Web.PageInspector.Loader.dll!Microsoft.VisualStudio.Web.PageInspector.Runtime.Loader.RuntimeLoader.GetRuntimeAssembly(out System.Reflection.Assembly runtime) + 0xdb bytes   
Microsoft.VisualStudio.Web.PageInspector.Loader.dll!Microsoft.VisualStudio.Web.PageInspector.Runtime.Loader.RuntimeLoader.LoadRuntime() + 0x2a bytes    
Microsoft.VisualStudio.Web.PageInspector.Loader.dll!Microsoft.VisualStudio.Web.PageInspector.Runtime.Loader.RuntimeLoader.PreApplicationStart() + 0x27 bytes    
[Native to Managed Transition]  
System.Web.dll!System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(System.Collections.Generic.ICollection<System.Reflection.MethodInfo> methods, System.Func<System.IDisposable> setHostingEnvironmentCultures) + 0x142 bytes 
System.Web.dll!System.Web.Compilation.BuildManager.InvokePreStartInitMethods(System.Collections.Generic.ICollection<System.Reflection.MethodInfo> methods) + 0x5a bytes 
System.Web.dll!System.Web.Compilation.BuildManager.CallPreStartInitMethods(string preStartInitListPath, out bool isRefAssemblyLoaded) + 0x67 bytes  
System.Web.dll!System.Web.Compilation.BuildManager.ExecutePreAppStart() + 0x9a bytes    
System.Web.dll!System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager appManager, System.Web.Hosting.IApplicationHost appHost, System.Web.Configuration.IConfigMapPathFactory configMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters hostingParameters, System.Security.Policy.PolicyLevel policyLevel, System.Exception appDomainCreationException) + 0x20a bytes   
System.Web.dll!System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager appManager, System.Web.Hosting.IApplicationHost appHost, System.Web.Configuration.IConfigMapPathFactory configMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters hostingParameters, System.Security.Policy.PolicyLevel policyLevel) + 0x16 bytes 
[Appdomain Transition]  
System.Web.dll!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(string appId, System.Web.Hosting.IApplicationHost appHost, System.Web.Hosting.HostingEnvironmentParameters hostingParameters) + 0x12f3 bytes 
System.Web.dll!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(string appId, System.Web.Hosting.IApplicationHost appHost, System.Web.Hosting.HostingEnvironmentParameters hostingParameters) + 0x25 bytes    
System.Web.dll!System.Web.Hosting.ApplicationManager.GetAppDomainWithHostingEnvironment(string appId, System.Web.Hosting.IApplicationHost appHost, System.Web.Hosting.HostingEnvironmentParameters hostingParameters) + 0x6c bytes  
System.Web.dll!System.Web.Hosting.ApplicationManager.CreateObjectInternal(string appId, System.Type type, System.Web.Hosting.IApplicationHost appHost, bool failIfExists, System.Web.Hosting.HostingEnvironmentParameters hostingParameters) + 0x4d bytes   
System.Web.dll!System.Web.Hosting.ProcessHost.StartApplication(string appId, string appPath, out object runtimeInterface) + 0x18f bytes 
[Native to Managed Transition]  
Run Code Online (Sandbox Code Playgroud)

这表明问题是微软的问题(而不是我所做过的事情,例如,汇编,应用程序和机器配置.)

我检查了所有的配置(字面意思,所有,我的项目的web.config以及所有.NET运行时机器配置,所有版本/平台),我无法在任何地方找到对此程序集的引用.

要解决这个错误(Microsoft需要解决的问题),我已经将一个程序集绑定重定向添加到我的web.config(不是我的机器配置):

  <dependentAssembly>
    <assemblyIdentity name="Microsoft.VisualStudio.Web.PageInspector.Runtime" publicKeyToken="b03f5f7f11d50a3a" />
    <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="12.3.0.0" />
  </dependentAssembly>
Run Code Online (Sandbox Code Playgroud)

这表明微软发布了一个Visual Studio或类似的版本,它绑定了这些程序集未来未发布的版本.

希望这有助于其他人!

  • 在安装VS2013社区版+更新后确认在我的VS2010项目中发生了这种情况.同时确认此解决方案有效.干得好!谢谢! (5认同)
  • "dependentAssembly元素"是"运行时"和"assemblyBinding"元素的子代 - 请参阅MSDN示例https://msdn.microsoft.com/en-us/library/b0yt6ck0%28v=vs.110%29.aspx (2认同)

小智 8

如果取消选中例外选项中的Thrown Exceptions,它应该停止提示您.我猜这是正常运作的一部分.我注意到了同样的事情.

  • 这不是一个解决方案/修复,这是一个hackish解决方法,因为如果你忽略它仍然会抛出异常.此外,这不是正常操作的一部分,这是微软在绑定到Visual Studio"vNext"程序集时的一个严重错误,该程序集永远不会与VS2013一起部署.他们需要解决它. (4认同)

Joe*_*oel 7

不要更改框架文件,请尝试将其添加到web.config文件中:

<system.web>
    <httpRuntime targetFramework="4.5" />
        <compilation debug="true" targetFramework="4.5" >
          <assemblies>
            <remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, 
               Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          </assemblies>
        </compilation>
    ...
</system.web>
Run Code Online (Sandbox Code Playgroud)