本地 - 我的MVC 4,asp.net,C#应用程序运行正常在IIS 8/Windows 8的无法加载文件或程序集“System.Web.Mvc,版本= 3.0.0.0,Elmah.MVC问题
当部署到Windows Server 2008,我得到这个错误:
Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
和
[FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
Elmah.Mvc.Bootstrap.Initialize() +0
[InvalidOperationException: The pre-application start initialization method Initialize on type Elmah.Mvc.Bootstrap threw an exception with the following error message: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +12881963
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +12881672
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +240
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): The pre-application start initialization method Initialize on type Elmah.Mvc.Bootstrap threw an exception with the following error message: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881108
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722297
出现这种情况,如果我选择了“项目部署”只运行该应用程序所需的文件“下拉在项目属性/包/发布我们湾
如果我选择“此项目中的所有文件”,它工作正常。
我猜Elmah是依赖于较旧版本的MVC或什么东西 - 我如何解决这个问题,而不必上传所有的文件?
问题的最佳解决方式是什么来解决这样的情况?
谢谢。
System.Web.Mvc的assemblyBinding配置为我工作! – EdmundYeung99
也为我工作:-) – Baconbeastnz
作品像ninject错误的魅力,谢谢! –