Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

C# Nuget package wrong dependency

$
0
0

Our C# application uses Nuget package Microsoft.Rest.ClientRuntime. As one of dependencies this Nuget package has installed Newtonsoft.Json Nuget package. Currently it looks like the following:

enter image description here

As I see the version of the Newtonsoft.Json assembly is 12.0.3.

After running the application I get the exception error:

Could not load file or assembly Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b

I really cant understand why it requires v. 10 if that should be v. 12?

The assembly that was copied to the output folder is v.12:

enter image description here

After long searching in the Internet I've tried to open the dll in the Net Reflector and so find that Microsoft.Rest.ClientRuntime assembly looks for Newtonsoft.Json v. 10 and not for v. 12 as that should be:

enter image description here

I've tried to update all the Nuget packages for the solution but that didn't help.

So my question - how can I fix that? Or how can I point it to the right assembly version?

Environment:

  • Visual studio 2019
  • .Net 4.7.2
  • Windows 10 x64

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>