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

asp.net-mvc-3 – SimpleMembership MVC3无法加载文件或程序集We

发布时间:2020-12-16 07:36:42 所属栏目:asp.Net 来源:网络整理
导读:我正在使用SimpleMembership.MVC3包来管理会员资格.一切都在开发中正常工作,但是当我部署到我的Azure Web角色时,它会引发以下异常: Could not load file or assembly ‘WebMatrix.Data,Version=1.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35’
我正在使用SimpleMembership.MVC3包来管理会员资格.一切都在开发中正常工作,但是当我部署到我的Azure Web角色时,它会引发以下异常:

Could not load file or assembly ‘WebMatrix.Data,Version=1.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)

stack trace: [FileLoadException: Could not load file or assembly
‘WebMatrix.Data,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)]
WebMatrix.WebData.PreApplicationStartCode.Start() +0

[InvalidOperationException: The pre-application start initialization
method Start on type WebMatrix.WebData.PreApplicationStartCode threw
an exception with the following error message: Could not load file or
assembly ‘WebMatrix.Data,
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.InvokePreStartInitMethods(ICollection`1
methods) +11711966
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +465
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager,IApplicationHost appHost,IConfigMapPathFactory
configMapPathFactory,HostingEnvironmentParameters hostingParameters,
PolicyLevel policyLevel,Exception appDomainCreationException) +1167

[HttpException (0x80004005): The pre-application start initialization
method Start on type WebMatrix.WebData.PreApplicationStartCode threw
an exception with the following error message: Could not load file or
assembly ‘WebMatrix.Data,
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) +11700896
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr,HttpContext context) +4869125

安装Nuget Package时没有下载WebMatrix.Data程序集.
我手动添加了在我的Program Files / Microsoft ASP.NET目录中找到的WeBMatrix.Data.DLL,但是这个程序集的版本是2.x,缺少的是版本1.x

缺什么?

解决方法

我遇到过同样的问题.我右键单击了项目中的Reference并转到了Properties.将CopyToLocal设置从True更改为False并重建项目.解决了我的问题.

(编辑:李大同)

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

    推荐文章
      热点阅读