asp.net-mvc - FileNotFound 尝试加载 "Microsoft.VisualStudio.Web.PageInspector.Runtime"的 v14.0.0.0

标签 asp.net-mvc visual-studio-2013 page-inspector

我有一个 MVC 项目,该项目一直运行良好,直到我一周前更新了我的机器。 我现在在尝试运行项目时收到绑定(bind)错误

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

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

如果我继续解决错误,项目将正确加载。 但是,当我将项目作为云服务中的 Web 角色运行时,它不会运行,因为它不断弹出,并且角色花费的时间比预期要长......消息

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

有人遇到过这种情况吗?

<小时/>

编辑 我在配置文件中搜索了程序集引用,但没有找到任何结果。 最终我只是重新安装了新的azure SDK。 加载时仍然会弹出页面检查器的绑定(bind)错误消息,但如果我继续该项目,它工作正常。目前,我将不得不忍受这个恼人的消息,直到找到解决方案

最佳答案

我在安装了 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]  

这表明问题是微软的(而不是我在程序集、应用程序或机器配置中做过的事情。)

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

为了解决此错误(Microsoft 需要解决),我已将程序集绑定(bind)重定向添加到我的 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>

这表明 Microsoft 发布了 Visual Studio 或类似版本,该版本与这些程序集的 future 未发布版本绑定(bind)。

希望这对其他人有帮助!

关于asp.net-mvc - FileNotFound 尝试加载 "Microsoft.VisualStudio.Web.PageInspector.Runtime"的 v14.0.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25521670/

相关文章:

ajax - ASP.Net MVC RC 单元测试 Ajax 请求

c# - 计算机重命名后调试

javascript - Visual Studio 2012 HTML 错误

vb.net - Web.config 正在被 msbuild 重命名

css - VS2012 页面检查器忽略文本阴影样式

visual-studio - Page Inspector 在 Visual Studio Preview 2015 中不起作用

asp.net-mvc - 不要缩小ASP .NET MVC 4 BundleConfig中的某些文件

asp.net-mvc - 如何在asp.net mvc中 self 重定向和更改参数?

c# - IEnumerable<> 在未引用的程序集中定义 - 新的 NuGet 类库项目

c++ - Visual Studio 2013 文档注释