Reputation: 124
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
Upvotes: 5
Views: 15173
Reputation: 449
This is most likely caused by the source package being incorrect, please see my answer on this question Package error question
Upvotes: 0
Reputation: 8031
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.
Bin
and Source
. The one that you
care about is the Bin
directory.Bin
, pick the one that corresponds to your framework of choice. .NET 3.5? 4.0? RT?Newtonsoft.Json.dll
copy this over to your project's bin
directory located inside the project's Debug
folder.References Folder
under your project name and select Add Reference
Browse
and find the Newtonsoft.Json.dll
, Hit Apply if necessary and then OK.Upvotes: 2
Reputation:
You've two options. The second one is a little more brute force.
Run VS 2013 in admin mode, then in BUILD, run a Clean, helps to-- ensure your config manager has the build option set to build and copy everytime. The will force it remove stale dll's to put new ones in
option 1:
If not delete the references manually.
Then go to the 2 folders where the packages, DLL's are installed. /Bin and /packages and delete the Newton.JSON DLL and the Newton.JSON folder Now reinstall
Option 2:
Go directly to step 2. VS 2013 will complain at first, about not finding a folder to delete. But will work.
PM> Install-Package Newtonsoft.Json done
Upvotes: 0