Failed to load file or assembly "WebMatrix.Data, Version = 3.0.0.0

Failed to load file or assembly "WebMatrix.Data, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35" or one of its dependencies. The system cannot find the specified file.

+9
asp.net-mvc
Apr 20 '14 at 10:38
source share
4 answers

Is this a solution that you created or downloaded (as an example or work done by a colleague)? You have installed a version of NuGet with data up to the version installed in Visual Studio, and you checked the installed packages for the project - you may need to restore the packages if you downloaded the solution from Source Control or as a zip file online.

The easiest way to do this is to make sure the NuGet Package Manager is updated in Tools> Extensions and Updates, and then (with the selected project selected in Visual Studio) choose Project> NuGet Package Management. If there are installed packages that are not found in your solution packages directory, NuGet should offer to restore them for you.

Alternatively, you can add a package that depends on this package, and you either do not have the package installed or the previous version is installed.

To install a package in the NuGet type- package manager console

Microsoft.AspNet.WebPages.Data Installation Package

Or, search for "Microsoft.AspNet.WebPages.Data" in the "Manage NuGet Packages" window, accessed using the instructions above.

If you have a previous version of the package installed, you may need to reassign this version number to version 3.0.0.0 using the following code in the project configuration file (most likely, Web.config) to avoid breaking packages with dependencies from the previous version-

<dependentAssembly> <assemblyIdentity name="WebMatrix.Data" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> 
+26
Apr 20 '14 at 11:24
source share

I had a similar issue and fixed it by following these steps:

  • Installing a package through the package manager console (from visual studio) Use the following commands:

    PM> Install the WebMatrix.Data package p>

    PM> Installation package WebMatrix.WebData p>

  • Add Binding Redirection in Web.config Between <runtime> </runtime> tags:

     <dependentAssembly> <assemblyIdentity name="WebMatrix.Data" publicKeyToken="31bf3856ad364e35" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly>
    <dependentAssembly> <assemblyIdentity name="WebMatrix.Data" publicKeyToken="31bf3856ad364e35" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> 

3.I copied both dll libraries from the folder: / YourProject / packages to the folder / YourProject / bin

(optional) If you cannot find the DLL files in the / YourProject / packages folder, try to find the DLL files in the / YourProject / bin / Debug folder and copy / paste them into the / YourProject / bin folder.

He solved the problem for me.

+3
Apr 28 '16 at 16:01
source share

The only thing that worked for me was editing the properties of the DLL (right-click on the WebMatrix.WebData DLL in the solution explorer and select "Properties"), changing the property "Copy local" to "true". The same goes for the WebMatrix.Data library.

0
Feb 27 '17 at 10:59 on
source share

The following solution helped us

Step 1: Delete the link to the service and create an application (it will show an error) Step 2: add the link to the service again → click the forward button Step 3: clear the "Reuse types in reference assemblies" check box, and then click "OK". step 4: rebuild the application

0
09 Oct '17 at 19:54 on
source share



All Articles