Could not 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 file specified.
There are some workarounds for this issue: The dll file may not be in /bin folder. Just copy the dll file to /bin folder or set this preference Copy Local = True from Visual Studio. If the problem persists, check if the version of the assembly that is referenced is different than the version it is looking for.
I had a similar problem, and I fixed it by doing the following:
Installing the package via package manager console(from visual studio) Use the following commands:
PM> Install-package WebMatrix.Data
PM> Install-package WebMatrix.WebData
Add a binding Redirect in Web.config file 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>
3.I've copied both dlls from: /YourProject/packages folder to /YourProject/bin folder
(Optional) If you can't find the dlls in /YourProject/packages folder, try search for the dlls in /YourProject/bin/Debug folder, and copy/Paste them into /YourProject/bin folder instead.
It solved the problem for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With