SimpleMembership MVC3 Failed to load file or assembly WebMatrix.Data

I use the SimpleMembership.MVC3 package for membership management. Everything works fine during development, but when I deploy my Azure web role, it throws the following exception:

Could not load file or assembly 'WebMatrix.Data, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. The installed manifest definition for the assembly does not match the assembly reference. (Exception from HRESULT: 0x80131040)

stack trace: [FileLoadException: could not load file or assembly 'WebMatrix.Data, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. The installed assembly manifest definition does not match the Help assembly. (Exception from HRESULT: 0x80131040)]
WebMatrix.WebData.PreApplicationStartCode.Start () +0

[InvalidOperationException: initializing start before application Method Start as WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Failed to load file or assembly 'WebMatrix.Data, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' one of his dependencies. The installed assembly manifest definition does not match the Help assembly. (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): initializing start before application Method Start as WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Failed to load file or assembly 'WebMatrix.Data, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 'or one of its dependencies. The installed assembly manifest definition does not match the Help assembly. (Exception from HRESULT: 0x80131040).]
System.Web.HttpRuntime.FirstRequestInit (HttpContext context) +11700896 System.Web.HttpRuntime.EnsureFirstRequestInit (HttpContext context) +141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate (IIS71269 context +)

There is no WebMatrix.Data assembly that loads when installing the Nuget package. I manually added the WeBMatrix.Data.DLL file found in my Program Files / Microsoft ASP.NET directory, but the version of this assembly is 2.x, and the missing version is 1.x

What is missing?

+4
source share
2 answers

I had the same problem. I right-clicked the link in the project and went to "Properties". Change the CopyToLocal parameter from True to False and rebuild the project. Solved my problem.

+18
source

Try adding a link from Nuget instead of a local link. This solved my problem.

Here is the package: https://www.nuget.org/packages/WebMatrix.Data/

+2
source

Source: https://habr.com/ru/post/1438180/


All Articles