无法加载文件或程序集System.Web.Mvc [英] Could not load file or assembly System.Web.Mvc

查看:663
本文介绍了无法加载文件或程序集System.Web.Mvc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的project.My项目工作用一把umbraco 4.11.3以及UTIL这是在Windows 7和从Visual Studio 2012中运行它。
但它并没有在Win 8的工作时,它从Visual Studio 2012中运行!

I'm using umbraco 4.11.3 in my project.My project work well util that's on Windows 7 and run it from visual studio 2012. But it did not work in Win 8 when it run from visual studio 2012!

错误是:

无法加载文件或程序'System.Web.Mvc,版本= 2.0.0.0,
  文化=中性公钥= 31bf3856ad364e35'或一个其
  依赖。找到的程序集清单定义不
  匹配程​​序集引用。 (异常来自HRESULT:0x80131040)

Could not load file or assembly 'System.Web.Mvc, Version=2.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)

说明:在执行过程中发生未处理的异常
  当前Web请求。有关详情,请堆栈跟踪
  有关错误的信息以及它起源于code。

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

异常详细信息:System.IO.FileLoadException:无法加载文件或程序
  集'System.Web.Mvc,版本= 2.0.0.0,文化=中立,
  公钥= 31bf3856ad364e35或它的一个依赖。该
  位于集清单定义不匹配的程序集
  参考。 (异常来自HRESULT:0x80131040)

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=2.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)

源错误:

的执行过程中生成了未处理的异常
  当前Web请求。有关的起源和位置信息
  除了可以使用异常堆栈跟踪下面来识别。

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

程序集加载跟踪:下列信息可以帮助
  确定程序集'System.Web.Mvc,版本= 2.0.0.0,
  文化=中性公钥= 31bf3856ad364e35'无法加载。

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

=== pre-绑定状态信息===日志:用户=汗-PC \\汗日志:显示名称= System.Web.Mvc,版本= 2.0.0.0,文化=中立,
  公钥= 31bf3856ad364e35(完全指定的)日志:应用平台=
  文件:/// G:/20130204/Source$c$c/Defraz.Movafaqiyat.WebApp/Defraz.Movafaqiyat.WebApp/
  LOG:初始PrivatePath =
  G:\\ 20130204 \\来源$ C ​​$ C \\ Defraz.Movafaqiyat.WebApp \\ Defraz.Movafaqiyat.WebApp \\ BIN
  调用汇编:ClientDependency.Core.Mvc,版本= 1.5.1.0,
  文化=中性公钥=空。
  ===日志:此绑定的默认加载上下文开始。日志:正在使用应用程序配置文件:
  G:\\ 20130204 \\来源$ C ​​$ C \\ Defraz.Movafaqiyat.WebApp \\ Defraz.Movafaqiyat.WebApp \\ web.config中
  日志:使用主机配置文件:
  C:\\用户\\汗\\文档\\ IISEx preSS \\设置\\ aspnet.config日志:正在使用
  从计算机配置文件
  C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\ CONFIG \\ machine.config中。
  日志:后政策参考:System.Web.Mvc,版本= 2.0.0.0,
  文化=中性公钥= 31bf3856ad364e35 LOG:尝试
  新的URL下载
  文件:/// C:/用户/汗/应用程序数据/本地/温度/临时ASP.NET
  文件/根/ bc5b37d0 / 42db0b24 / System.Web.Mvc.dll程序。 LOG:试图
  新的URL下载
  文件:/// C:/用户/汗/应用程序数据/本地/温度/临时ASP.NET
  文件/根/ bc5b37d0 / 42db0b24 / System.Web.Mvc / System.Web.Mvc.dll程序。日志:
  新的URL下载尝试
  file:///G:/20130204/Source$c$c/Defraz.Movafaqiyat.WebApp/Defraz.Movafaqiyat.WebApp/bin/System.Web.Mvc.DLL.
  警告:比较程序集名称时发生不匹配:主要
  版本错误:未能完成组装(HR = 0x80131040)的设置。
  探测终止。

=== Pre-bind state information === LOG: User = Jahan-PC\jahan LOG: DisplayName = System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (Fully-specified) LOG: Appbase = file:///G:/20130204/SourceCode/Defraz.Movafaqiyat.WebApp/Defraz.Movafaqiyat.WebApp/ LOG: Initial PrivatePath = G:\20130204\SourceCode\Defraz.Movafaqiyat.WebApp\Defraz.Movafaqiyat.WebApp\bin Calling assembly : ClientDependency.Core.Mvc, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in default load context. LOG: Using application configuration file: G:\20130204\SourceCode\Defraz.Movafaqiyat.WebApp\Defraz.Movafaqiyat.WebApp\web.config LOG: Using host configuration file: C:\Users\jahan\Documents\IISExpress\config\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 LOG: Attempting download of new URL file:///C:/Users/jahan/AppData/Local/Temp/Temporary ASP.NET Files/root/bc5b37d0/42db0b24/System.Web.Mvc.DLL. LOG: Attempting download of new URL file:///C:/Users/jahan/AppData/Local/Temp/Temporary ASP.NET Files/root/bc5b37d0/42db0b24/System.Web.Mvc/System.Web.Mvc.DLL. LOG: Attempting download of new URL file:///G:/20130204/SourceCode/Defraz.Movafaqiyat.WebApp/Defraz.Movafaqiyat.WebApp/bin/System.Web.Mvc.DLL. WRN: Comparing the assembly name resulted in the mismatch: Major Version ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

堆栈跟踪:

[FileLoadException:未能加载文件或程序'System.Web.Mvc,
  版本= 2.0.0.0,文化=中性公钥= 31bf3856ad364e35'或
  它的一个依赖。在位于集清单定义
  不匹配的程序集引用。 (从HRESULT异常:
  0x80131040)]结果
  ClientDependency.Core.Mvc.MvcFilter.ValidateCurrentHandler()+ 0结果
  ClientDependency.Core.Module.ClientDependencyModule.b__0(IFilter的
  F)+31 System.Linq.Enumerable.Any(IEnumerable的 1来源,Func键 2
  predicate)+146结果
  ClientDependency.Core.Module.ClientDependencyModule.ValidateCurrentHandler(IEnumerable`1
  过滤器)+127结果
  ClientDependency.Core.Module.ClientDependencyModule.HandleRequest(对象
  发件人,EventArgs五)+179结果
  System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  +136 System.Web.HttpApplication.ExecuteStep(IExecutionStep一步,布尔和放大器; completedSynchronously)+69

[FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=2.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)]
ClientDependency.Core.Mvc.MvcFilter.ValidateCurrentHandler() +0
ClientDependency.Core.Module.ClientDependencyModule.b__0(IFilter f) +31 System.Linq.Enumerable.Any(IEnumerable1 source, Func2 predicate) +146
ClientDependency.Core.Module.ClientDependencyModule.ValidateCurrentHandler(IEnumerable`1 filters) +127
ClientDependency.Core.Module.ClientDependencyModule.HandleRequest(Object sender, EventArgs e) +179
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

请注意:在IIS上发布的项目运作良好的Win7和Win8的。
     我的项目是不是基于ASP.NET MVC。
请帮我。

Note:published project on IIS works well in win7 and win8. My project isn't based on ASP.NET MVC. Please help me.

推荐答案

我们正在使用Azure云来运行部署和我同样的错误。既然你不能真正安装包到服务器实例,解决这个问题的方法是进入参考为您的项目,找到引用到它的抱怨缺少,进入属性库,然后将复制本地为True。重新部署和你所有的设置。

We're using Azure cloud to run a deployment and I got the same error. Since you can't really install packages onto the server instances, the way to solve this is to go into References for your project, find the reference to the library that it's complaining is missing, go into properties, then set Copy Local to True. Redeploy and you're all set.

这篇关于无法加载文件或程序集System.Web.Mvc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆