5

Can I use JSON.NET in Visual Studio 2008 with .NET 3.5 Compact Framework? And how can I install/Configure it in the IDE? I've searched the internet but could not find it.

I found this NuGet Support for Visual Studio 2008 to try install JSON.NET through NuGet but could not get it working. The result of this tutorial was an error Unable to find package 'your.package.name':

Error Message

dbc
  • 104,963
  • 20
  • 228
  • 340
trebew
  • 121
  • 2
  • 2
  • 9

2 Answers2

12

I don't think NuGet will help you here. Json.NET removed support for the .NET 3.5 Compact Framework in release 4.0.1, as is stated in the 4.0.1 release notes:

Other major changes in this release are two new builds and the removal of an existing build. Removed is Compact Framework. VS2010 no longer supports Compact Framework so 3.5 r8 will be its last release if you are targeting the Compact Framework.

The most recent version of Json.NET that does support it is 3.5.8, which you can download manually from here:

https://github.com/JamesNK/Newtonsoft.Json/releases/download/3.5.8/Json35r8.zip

Having manually downloaded Json35r8.zip, you can unzip the file, navigate to Json35r8\Bin\Compact, and manually add a reference to Newtonsoft.Json.Compact.dll using the Add Reference dialog box.

Note that Json.NET 3.5.8 is old enough that some basic things are broken. See e.g. JSON.net CF 3.5, verify that JSON is complete for an example.

dbc
  • 104,963
  • 20
  • 228
  • 340
  • I'll try it, but can you tell a better library to work with this version of .NET? – trebew Mar 28 '18 at 23:58
  • @trebew - Lots of stuff works with .Net 3.5 but [tag:compact-framework] is old technology for which Microsoft dropped Visual Studio support in 2010. I don't think you're going to find much now. See e.g. [Does the compact framework 3.5 support System.Runtime.Serialization?](https://stackoverflow.com/q/10049863/3744182) for which the answer is "No". But you can try Json.NET 3.5 r8, it might well do everything you need. – dbc Mar 29 '18 at 00:41
0

You should replace your.package.name by Newtonsoft.Json
Full argument is: install Newtonsoft.Json -excludeversion -outputDirectory .\Package

Cao Mạnh Quang
  • 1,027
  • 11
  • 10