我用一把umbraco 4.11.6在我的网站(Web应用程序)。我的网站是在本地主机的工作(从Visual Studio 2012和IIS(V7)进行测试),但是当我从互联网空间中运行它,我得到了一个错误。 错误是:
无法加载文件或程序集“System.Web.Razor”或它的一个依赖。 在位于集清单定义不匹配的程序集引用。 (从HRESULT异常:0x80131040)
程序集加载跟踪:下列信息有助于确定程序集“System.Web.Razor”无法加载。
警告:程序集绑定日志记录被关闭。 要启用程序集绑定失败日志记录,注册表值!HKLM \ SOFTWARE \微软\融合EnableLog](DWORD)设置为1.注意:有一些与程序集绑定失败日志记录关联的性能损失。 要关闭此功能,请移除注册表值[HKLM \软件\微软\融合!EnableLog。
堆栈跟踪:
[FileLoadException:未能加载文件或程序集“System.Web.Razor”或它的一个依赖。 在位于集清单定义不匹配的程序集引用。 (从HRESULT异常:0x80131040)]
[FileLoadException:未能加载文件或程序集“System.Web.Razor,版本= 2.0.0.0,文化=中性公钥= 31bf3856ad364e35”或它的一个依赖。 在位于集清单定义不匹配的程序集引用。 (从HRESULT异常:0x80131040)] System.Reflection.RuntimeAssembly._nLoad(的AssemblyName文件名,字符串的代码库,证据assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark&stackMark,IntPtr的pPrivHostBinder,布尔throwOnFileNotFound,布尔forIntrospection,布尔suppressSecurityChecks)+0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(的AssemblyName assemblyRef,证据assemblySecurity,RuntimeAssembly reqAssembly,StackCrawlMark&stackMark,IntPtr的pPrivHostBinder,布尔throwOnFileNotFound,布尔forIntrospection,布尔suppressSecurityChecks)210
System.Reflection.RuntimeAssembly.InternalLoad(字符串assemblyString,证据assemblySecurity,StackCrawlMark&stackMark,IntPtr的pPrivHostBinder,布尔forIntrospection)242
System.Reflection.RuntimeAssembly.InternalLoad(字符串assemblyString,证据assemblySecurity,StackCrawlMark&stackMark,布尔forIntrospection)17 System.Reflection.Assembly.Load(字符串assemblyString)35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串的AssemblyName,布尔starDirective)+122[ConfigurationErrorsException:未能加载文件或程序集“System.Web.Razor,版本= 2.0.0.0,文化=中性公钥= 31bf3856ad364e35”或它的一个依赖。 在位于集清单定义不匹配的程序集引用。 (从HRESULT异常:0x80131040)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串的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(字符串preStartInitListPath)+203
System.Web.Compilation.BuildManager.ExecutePreAppStart()+152
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager AppManager的,IApplicationHost APPHOST,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,异常appDomainCreationException)1151[HttpException(0X80004005):无法加载文件或程序集System.Web.Razor,版本= 2.0.0.0,文化=中性公钥= 31bf3856ad364e35'或它的一个依赖。 在位于集清单定义不匹配的程序集引用。 (从HRESULT异常:0x80131040)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext的上下文)12881540 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext的上下文)159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest WR,HttpContext的上下文)12722601版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.17929
WebConfig的一部分:
<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>