Could not load file or assembly 'EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I only get this error when I add this code into my project:
private IUserRepository repository;
public SearchController(IUserRepository repo)
{
repository = repo;
}
I suppose that makes sense as I'm using EntityFramework for this. I'm just now sure how to fix this bug.
I've looked at this link: http://msdn.microsoft.com/en-us/library/e74a18c4.aspx Though I'm not sure how to use this program? (It's always blank).
I think that this bug may have something to do with the fact that my database is hosted by dotnet-host.com and that there's some local references that break when it interacts with the database online.
'EntityFramework' could not be loaded due to an error. What the error is telling you is that your project referenced a different version of EntityFramework. dll than it found at runtime. ... Check which version of EntityFramework. dll did you reference in your project (update your question). ...
Go to references --> Add Reference --> in the dialog, choose COM and press browse. Then go to your project which is using EF and go to the projects bin folder where the EF references are stored. Select the EntityFramework.
What the error is telling you is that your project referenced a different version of EntityFramework.dll than it found at runtime.
Check which version of EntityFramework.dll did you reference in your project (update your question).
Make sure you copy all the relevant dll and *.manifest into application's bin folder.
Since It's an external host, You might need to install the EntityFramework through WebMatrix Package Manager. If you do, you can follow this tutorial.
Specific Version = false
on EntityFramework dlls (Note I'm not sure if it will work, because I always try to develop and deploy using the same versions, so maybe somebody can confirm?).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