我正在使用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