. Advertisement .
. Advertisement .
I am trying to write a csharp that returns an invalid answer. I don’t know where the incorrect command is in the “could not load file or assembly ‘newtonsoft.json version=22.214.171.124.”
My detail is:
<Reference Include="Newtonsoft.Json, Version=126.96.36.199, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> </Reference>
<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/> </startup> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-188.8.131.52" newVersion="184.108.40.206" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
and I end up with the warning message:
System.IO.FileNotFoundException: 'Could not load file or assembly 'Newtonsoft.Json, Version=220.127.116.11, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified.'
Pls, suggest the best answer to fix it.
The cause: The cause of this error is that a version incompatibility. It says in your error that the library version “18.104.22.168” could not be found. The version stated in your configuration reference is “12.0.3.”
Solution: You can fix this error by uninstalling the nugets, checking in, reinstalling them and building (and checking in again)
In my case, I installed V 22.214.171.124 using the Nuget package. I received the same error. Based on my personal experience, Some NewtonSoft version are having trouble with Visual Studio.
If you only require deserialize or serialize functionality you can solve your problem by reinstalling the Newtonsoft current solution and installing the version 6.0.3
This version is compatible with different versions of visual studio.