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

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....