29

I pasted the code from http://www.codeproject.com/Tips/789481/Bridging-the-Gap-between-Linqpad-and-Visual-Studio into Visual Studio 15. It tells me that 'Newtonsoft' could not be found. I open the folder "\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies" and found that the file Newtonsolft.Json.dll is already there. Could anyone tell me how to fixed problem?


enter image description here

Vivek Nuna
  • 25,472
  • 25
  • 109
  • 197
Ben Tam
  • 587
  • 3
  • 7
  • 11

7 Answers7

41

Solution Explorer->Right Click on Project Name -> Click on Manage Nuget Packages -> Search for newtonsoft -> Click on install button

Vivek Nuna
  • 25,472
  • 25
  • 109
  • 197
  • 12
    what if it is already installed and it cannot be uninstalled because it depend on other (to me unknown) .dlls ? – Muflix Jan 19 '17 at 11:38
  • 1
    because i though new installation will resolve the problem, i updated the package but iam still getting the same error as asker – Muflix Jan 19 '17 at 12:00
  • 1
    Do you have reference added for NewtonSoftJSon.dll in your project? – Vivek Nuna Jan 19 '17 at 12:02
12

Go to Tools -> Library Package Manager -> Package Manager Console

enter image description here

and in the console just write Install-Package Newtonsoft.Json -Version 9.0.1

enter image description here

Mohit S
  • 13,723
  • 6
  • 34
  • 69
12

For me I had the package already installed but it was missing the references and it could not be added. Helped me: in NuGet Package Manager to downgrade and upgrade Newtonsoft.Json

LopDev
  • 823
  • 10
  • 26
j.j.a.c.k.
  • 435
  • 1
  • 6
  • 11
6

You have to get the correct NuGet package. From your link:

enter image description here

You can open the NuGet package manager in: Tools -> Nuget Packet Manager -> Manage Nuget Packages for Solution..

Skyqula
  • 429
  • 1
  • 8
  • 17
3

I had a similar problem and Google API's had a dependency on Newtonsoft.Json, not allowing me to uninstall Newtonsoft.Json and trying to reinstall.

Removing and and reinstalling Newtonsoft.Json will likely solve the problem, but in my situation, I had to go into Nuget Package Manager -> find Newtonsoft.Json -> select Options dropdown -> check "Force uninstall even if there are dependencies on it".

Checking that box allowed me to remove and subsequently reinstall Newtonsoft and the solution properly referenced it after.

enter image description here

danielj23
  • 83
  • 1
  • 1
  • 5
2

I had the same problem with visual studio 2019. Simply restarting visual studio fixed the issue. After restarting, the References list in Solution Explorer did show the "Newtonsoft.json".

Tornseglare
  • 963
  • 1
  • 11
  • 24
0

Right click on the client project side and select Manage NuGet packages. Then search for Newtonsoft.Json on browse and install. If the class you are trying to use Newtonsoft is in client you must install the package for the client.

Adelin
  • 35
  • 3