This error indicates that there is a version mismatch between what is referenced by the assembly (<Y.Y.Y.Y>) and what the project is pointed towards (<Z.Z.Z.Z>). To correct this, you need to re-add the correct reference in Solution Explorer. Confirm that the DLL version <Y.Y.Y.Y> is present on your computer.
I had this error because "Rebuild" was not really rebuilding.
Solution: Close Visual Studio, really go and delete the bin folder, then rebuild, it might work better.
Also, sometimes Visual Studio lies about references, so check the HintPath
in your .csproj
files.
If you're using NuGet it is worth going to 'Manage NuGet Packages For Solution', finding the package which is causing issues and hitting update. It should then bring all of the packages up to the latest version and resolve the problem.
Worth a shot as it's a quick and easy.
3 ideas for you to try:
My problem was that I had 2 projects referencing 2 different copies of the same dll which had different versions. I fixed it by removing them both and making sure they were referencing the same dll file.
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