I've been stuck with this bug after merging two branches together. The solution builds with no issues, but as soon as I call any function that uses Newtonsoft.Json
I get the following exception at runtime:
Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
I've looked around and have tried:
- Re-installing the nuget package on the affected project
- Re-installing the nuget package on all projects running Newtonsoft.Json
- Updating all projects in the solution to be the same version of Newtonsoft.Json, then cleaning and rebuilding the solution
- Digging through .csproj files to find Newtonsoft references and manually updating them to the same version.
When I manually copy and paste the 6.0.0.0
dll into the debug folder I get no issues, however as soon as I clean/ rebuild Visual Studio puts the wrong dll version into the folder again. Even after updating the Nuget package in the affected project to the latest version of Newtonsoft.Json the error still states that it is looking for version 6.0.0.0
rather than 12.0.0.0
.
Am I missing something? Any help would be appreciated.
EDIT:
Using .net Framework 4.7
Just to clarify: when I say "wrong dll" I meant it puts the dll that I want it to use in the bin folder (12.0.0.0
), but the program see's it as the wrong version, expecting version 6.0.0.0
.