I've set up my project with Visual Studio Express 2012, added some C# code, and successfully compiled/deployed to emulator. At some point I decided I want to do something with JSON, and I found that I should use the Json.NET framework, which is available as a NuGet package. I have added this framework successfully using the command Install-Package Newtonsoft.Json
.
I tried to install an update which MSVC offered two days ago, and the installation failed, leaving me unable to open my project again. Reinstalling MSVC didn't help, so I ended up restoring Windows to a previous state. I was able to open my project again, and I wanted to reinstall the NuGet package (not knowing it is installed inside the project, not MSVC). It gave me errors upon installing, so I tried to uninstall everything from package console.
Long story short:
- Nuget package console says "no packages installed" when
Get-Package
- Running
Install-Package Newtonsoft.Json
again gives me the errorNewtonsoft.Json 5.0.6 could not be installed. You try to install this package in a project referencing "WindowsPhone,Version=v8.0", the package however does not contain assemblies compatible with this framework
- The "Manage NuGet" packages dialog shows no packages under "installed", however in the online package, the json package is listed and marked as installed (so I cannot try to install it)
Now I'm completely lost. I don't know how to install the package properly, nor how to remove it properly. Is my project file broken? How can I repair it?
[edit] Now it gets even more confusing. I've just updated the NuGet package manager (not MSVC though), and tried to reinstall Json.NET.
- In the dialog it's still not shown under "installed"
- In the online packages list it is no more marked as installed, but clicking "Install" just does nothing
Get-Package
in the console shows the package as installedPM> Get-Package Id Version Description/Release Notes -- ------- ------------------------- Newtonsoft.Json 5.0.6 Json.NET is a popular high-performance JSON framework for .NET
Trying to uninstall with `Uninstall-Package Newtonsoft.Json" gives "The Package 'Newtonsoft.Json' could not be found"
- In my project folder I can see a "Newtonsoft.Json.5.0.6" subfolder in the
packages
directory
Should I just start over from scratch and create a new project? :/
Contents of packages.dgml:
<?xml version="1.0" encoding="utf-8"?>
<DirectedGraph GraphDirection="LeftToRight" xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes />
<Links />
<Categories>
<Category Id="Projekt" />
<Category Id="Paket" />
</Categories>
<Styles>
<Style TargetType="Node" GroupLabel="Projekt" ValueLabel="True">
<Condition Expression="HasCategory('Projekt')" />
<Setter Property="Background" Value="Blue" />
</Style>
</Styles>
</DirectedGraph>
packages.config
and remove theNewtonsoft.Json
entry - that should solve your third bullet point. Then maybe you will be able to re-install it from the NuGet Package Manager window. Your second bullet point makes me kind of doubt it though... – Chessy