In my project i used the library Newtonsoft.Json version 11.0.2, and i need use Google.Api and Google.Core, but when install this two library i receive the next error:
System.IO.FileLoadException: '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. (Exception from HRESULT: 0x80131040)'
The error is because Google.Core use the version of newtonsoft.json 12.0.3 and in my project i have the version 11.0.2.
When made the build in output i can see the next error:
NU1605: Detected package downgrade: Newtonsoft.Json from 12.0.3 to 11.0.2. Reference the package directly from the project to select a different version. MyProject -> Google.Apis.Oauth2.v2 1.48.0.1869 -> Google.Apis.Auth 1.48.0 -> Google.Apis.Core 1.48.0 -> Newtonsoft.Json (>= 12.0.3) MyProject -> Newtonsoft.Json (>= 11.0.2)
How should to fix this error?
Can you try updating the package to the latest version in your project? Try remove all the references of the Newtonsoft.Json (11.0.2) from your project and install the latest update from Nuget. Hope that works.
User contributions licensed under CC BY-SA 3.0