I am trying to do something pretty simple here, and I've been stuck on it for several hours. I feel like I've exhausted almost every option.
All I am trying to do is:
JsonConvert.SerializeObject(model)
However, the resulting error is:
Exception thrown: 'System.IO.FileLoadException' in mscorlib.dll
Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=982hs0cm1kd' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
However, in my project, I am referencing version 10.0.0.0. More Specifically, 10.0.2.0. When I checked my bin folder for the project, I can verify that the 10.0.2.0 dll is there. In packages.config, I have <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
Things I have tried:
C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root
I am really stuck here, and I can see this is a common problem as I found a lot of different approaches to fix it, however none have worked so far.
Any ideas?
In package manager console execute: Update-Package –reinstall Newtonsoft.Json.
source
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