首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >无法加载文件或程序集“”System.Web.Razor“”或其依赖项之一

无法加载文件或程序集“”System.Web.Razor“”或其依赖项之一
EN

Stack Overflow用户
提问于 2013-04-08 16:18:00
回答 6查看 64.9K关注 0票数 25

我在我的网站(web应用程序)中使用了Umbraco 4.11.6,.My网站在本地主机上工作(从Visual studio 2012和IIS(V7)测试),但当我从互联网空间运行它时,我得到了一个错误。错误是:

未能加载文件或程序集“System.Web.Razor”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(HRESULT异常: 0x80131040)

程序集加载跟踪:以下信息有助于确定无法加载程序集“System.Web.Razor”的原因。

警告:程序集绑定日志记录已关闭。若要启用程序集绑定失败日志记录,请将注册表值HKLM\Software\Microsoft\Fusion!EnableLog设置为1。注意:程序集绑定失败日志记录会带来一些性能损失。若要关闭此功能,请删除注册表值HKLM\Software\Microsoft\Fusion!EnableLog。

堆栈跟踪:

FileLoadException:未能加载文件或程序集“System.Web.Razor”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(HRESULT异常: 0x80131040) FileLoadException:无法加载文件或程序集“”System.Web.Razor,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35“”或其依赖项之一。“”找到的程序集的清单定义与程序集引用不匹配。(HRESULT异常: 0x80131040) System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,字符串codeBase,证据assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks) +0

System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据assemblySecurity,RuntimeAssembly reqAssembly,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks) +210

System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,Evidence,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,Boolean forIntrospection) +242

System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,Evidence,StackCrawlMark& stackMark,Boolean forIntrospection) +17 System.Reflection.Assembly.Load(String assemblyString) +35

System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,布尔型starDirective) +122

ConfigurationErrorsException:未能加载文件或程序集'System.Web.Razor,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35‘或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(HRESULT异常: 0x80131040)

System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,布尔型starDirective) +12761078

System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +503 System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +142 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334

System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +203

System.Web.Compilation.BuildManager.ExecutePreAppStart() +152

System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager、IApplicationHost appHost、IConfigMapPathFactory configMapPathFactory、HostingEnvironmentParameters hostingParameters、policyLevel PolicyLevel、Exception appDomainCreationException) +1151

HttpException (0x80004005):未能加载文件或程序集'System.Web.Razor,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35‘或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(HRESULT异常: 0x80131040)

System.Web.HttpRuntime.FirstRequestInit(HttpContext上下文) +12881540 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext上下文) +159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext上下文) +12722601

版本信息:微软.NET框架版本:4.0.30319;ASP.NET版本:4.0.30319.17929

WebConfig的一部分:

代码语言:javascript
复制
<runtime>
<!-- Old asp.net ajax assembly bindings -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
  </dependentAssembly>
</assemblyBinding>

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15874366

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档