Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not install : Newtonsoft.Json

I want to download and parse the JSON in my Windows Phone project, so I decided to download newtonsoft.json library via Nuget in Visual Studios, but I'm receiving the following:

PM> Install-Package Newtonsoft.Json
Successfully installed 'Newtonsoft.Json 6.0.1'.
Successfully uninstalled 'Newtonsoft.Json 6.0.1'.
Install failed. Rolling back...

Install-Package : Could not install package 'Newtonsoft.Json 6.0.1'. You are trying to install this package into a project that targets 'WindowsPhone,Version=v8.0', but the package does not 
contain any assembly references that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
 + Install-Package Newtonsoft.Json
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
 + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
like image 572
user2068754 Avatar asked Nov 01 '22 04:11

user2068754


1 Answers

Download the component (aka DLL) from here: http://james.newtonking.com/json

Note: Make sure to delete any previous Nuget traces of the old Newtonsoft component you had. Just to make sure things are clear before you attempt to do this.

  • Once downloaded, extract the contents of the compressed file to a folder.
  • You will see two directories, Bin and Source. The one that you care about is the Bin directory.
  • You will find additional directories within Bin, pick the one that corresponds to your framework of choice. .NET 3.5? 4.0? RT?
  • You will find the Newtonsoft.Json.dll copy this over to your project's bin directory located inside the project's Debug folder.
  • Open your project in Visual Studio, right click on the References Folder under your project name and select Add Reference
  • Click Browse and find the Newtonsoft.Json.dll, Hit Apply if necessary and then OK.
like image 183
Dayan Avatar answered Nov 15 '22 06:11

Dayan