无法加载文件或程序集'System.Web.WebPages.Razor,Version = 2.0.0.0,Culture = neutral或其依赖项之一 [英] Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, or one of its dependencies
问题描述
请有人帮我解决此问题.
Please somebody help me fix this issue.
作为IIS6上的父级的Umbraco应用程序具有以下版本的System.Web.WebPages.Razor.
Umbraco application as parent on IIS6 has the following version of System.Web.WebPages.Razor.
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
<system.web.webPages.razor>
<host factoryType="System.Web.WebPages.Razor.WebRazorHostFactory, System.Web.WebPages.Razor" />
<pages pageBaseType="System.Web.WebPages.WebPage">
<namespaces>
<add namespace="Microsoft.Web.Helpers" />
<add namespace="umbraco" />
<add namespace="Examine" />
</namespaces>
</pages>
IIS6上的Umbraco应用程序下作为虚拟目录的Blog Engine应用程序具有以下版本的System.Web.WebPages.Razor.
Blog Engine application as virtual directory under the Umbraco application on IIS6 has the following version of System.Web.WebPages.Razor.
<configSections>
<remove name="system.web.webPages.razor" />
</configSections>
<assemblies>
<add assembly="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
即使我添加了dependentAssembly,仍然对我没有任何帮助,但在这个问题上却浪费了一个多星期,请帮忙.
Even after i added the dependentAssembly still nothing works for me, Am wasting more than a week on this issue, Please help.
推荐答案
@ProNotion是正确的,我已经看到越来越多的Umbraco软件包依赖于特定版本的程序集,从而导致程序集冲突,特别是如果两个程序包需要不同版本的程序集时.相同的程序集.
@ProNotion is right, I have seen more and more packages on Umbraco relying on specific versions of assemblies causing assemblies to conflict especially if two packages need different versions of the same assembly.
其他一些提示:
This tool from MS helps diagnose assembly binding problems (http://msdn.microsoft.com/en-us/library/e74a18c4%28v=vs.71%29.aspx).
在您的web.config中添加运行时/assemblyBinding部分可以解决与冲突的程序集有关的问题(
Adding a runtime / assemblyBinding section to your web.config can work round problems with clashing assemblies (http://msdn.microsoft.com/en-us/library/0ash1ksb(v=vs.110).aspx)
有时程序集不会被复制(例如,您使用msbuild并且该程序集未包含在项目中)-因此,您还应该检查程序集是否已将其复制到实时服务器中.
Sometime the assembly doesn't get copied (eg you use msbuild and the assembly isn't included in the project) - so you should also check to see if the assembly made it to the live server.
这篇关于无法加载文件或程序集'System.Web.WebPages.Razor,Version = 2.0.0.0,Culture = neutral或其依赖项之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!