加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc-3 – 无法加载文件或程序集’System.Web.Mvc,Versio

发布时间:2020-12-16 07:06:17 所属栏目:asp.Net 来源:网络整理
导读:我已经看过类似的帖子,但没有找到一个帮助解决这个问题. 简而言之,我有一个在azure上运行的mvc3项目.几天前由于某种原因,它失去了对System.Web.MVC的引用.所以我添加了引用并将Copy Local属性更改为True. 它在本地模拟器上构建并运行ok.然后我发布它并在访问
我已经看过类似的帖子,但没有找到一个帮助解决这个问题.

简而言之,我有一个在azure上运行的mvc3项目.几天前由于某种原因,它失去了对System.Web.MVC的引用.所以我添加了引用并将Copy Local属性更改为True.
它在本地模拟器上构建并运行ok.然后我发布它并在访问网站时收到以下消息.

“无法加载文件或程序集’System.Web.Mvc,Version = 3.0.0.0”

事实证明我只有3.0.0.1版本,而不是3.0.c.0,这在我的web.congig文件中有说明.我已经尝试将程序集和运行时部分中的web.config中的值更改为3.0.0.1但是这会在azure中引发另一个异常.(虽然没有更改公共令牌)

我也尝试过Add Deployable Dependency,但这没有任何区别,我已经尝试下载并将3.0.0.0版本添加到项目中,但vs在发布时并不喜欢这个dll.

我也尝试将程序集的属性版本更改为False,但这没有用.

所以由于某种原因我不再使用v3.0.0.0但不知道如何更改我的项目以使用v3.0.0.1我想.

Server Error in ‘/’ Application.

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser 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)

Source Error:
Line 39:
Line 40:
Line 41:
Line 42:
Line 43:

Source File: E:sitesrootweb.config Line: 41

Assembly Load Trace: The following information can be helpful to determine why the assembly ‘System.Web.Mvc,PublicKeyToken=31bf3856ad364e35’ could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging,set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off,remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].

解决方法

多谢你们.我实际上只是注释了mvc汇编的汇编代码行,并更改了运行时绑定代码以在web.config中查找v 3.0.0.1并且这已经完成了.我不确定这是否是最好的解决方案,但花了一天多的时间才是最重要的因素.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读