微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

我正在使用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并重建项目.解决了我的问题.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐