48

I am trying to download JSON.NET from NuGet.
Is it available? What's the correct command?

the_drow
  • 18,571
  • 25
  • 126
  • 193

2 Answers2

101

You can do this a couple of ways.

Via the "Solution Explorer"

  1. Simply right-click the "References" folder and select "Manage NuGet Packages..."
  2. Once that window comes up click on the option labeled "Online" in the left most part of the dialog.
  3. Then in the search bar in the upper right type "json.net"
  4. Click "Install" and you're done.

Via the "Package Manager Console"

  1. Open the console. "View" > "Other Windows" > "Package Manager Console"
  2. Then type the following:
    Install-Package Newtonsoft.Json

For more info on how to use the "Package Manager Console" check out the nuget docs.

Mateo
  • 1,920
  • 2
  • 21
  • 27
  • Will this be saved into the Visual Studio solution so anyone else opening it will get the same package installed? – parsley72 May 05 '13 at 00:51
  • 3
    Yes. It will be stored in a packages folder within the solution's directory structure. – Mateo May 05 '13 at 22:06
  • I can't get this to work with visual studio express 2008, is there another way? – Rickard B. Jan 08 '15 at 21:53
  • @RickardB. yes and no. Since the express versions of Visual Studio don't allow for extensions you will have to use the command line version of NuGet found at http://nuget.codeplex.com. One caveat with this method is the fact that your project will need to be linked to the dependency you retrieve from the NuGet servers. – Mateo Jan 12 '15 at 04:59
  • 1
    @Mateo, Thank you for the answer. I assumed that might be the case, so i installed VS 2013 community edition instead. Works like a charm! – Rickard B. Jan 12 '15 at 07:18
  • Perfect Thanks! Installing newtonsoft.json worked great. – Enkode Sep 11 '15 at 19:54
  • As a side note, newer versions of Visual Studio seem to include this if you create a WebAPI project. – Powerlord Mar 22 '16 at 18:39
2

I have Had the same issue and the only Solution i found was open Package manager> Select Microsoft and .Net as Package Source and You will install it..

enter image description here

NSNoob
  • 5,548
  • 6
  • 41
  • 54