2

today I have a simple json object like this:

[
    {
        "Code": "My Sample Code",
        "Description": "My Sample Description",
        "Permissions": [
            {
                "Id": 432,
                "Name": "FIRSTPERMISSION"
            },
            {
                "Id": 32,
                "Name": "SECONDPERMISSION"
            }
        ]
    }
]

And I`m trying to bind it to an object. But the problem is: I'm on .Net Framework 1.1, which doesn't have the principal classes to do this work, like:

  • None of the Newtonsoft.Json (Json.Net) classes
  • System.Runtime.Serialization.Json.DataContractJsonSerializer
  • System.Web.Script.Serialization.JavaScriptSerializer
  • System.Runtime.Serialization.DataContractSerializer

And I tried to add Newtonsoft.Json reference from .net framework 2.0 to my app, without success.

How can I put the json string values into a object, to work with this?

Thanks a lot :-)

dbc
  • 104,963
  • 20
  • 228
  • 340
Otávio Larrosa
  • 303
  • 2
  • 12
  • [JSON Object Serializer .Net 1.1](https://archive.codeplex.com/?p=jsonserializer). Never tested. – Jimi May 19 '19 at 17:19
  • Hello Jimi, I tried, but Json Object Serializer, is only for Serialize an Object to a Json String, also I have opened the source code to check if I'm wrong. But not :/ Thanks a lot :-) – Otávio Larrosa May 19 '19 at 17:21
  • 5
    upgrade to a newer framework ;) – Jonathan Alfaro May 19 '19 at 17:23
  • 1
    I'd agree on the upgrade. Why fight this in an ancient framework when the tools are easily available in supported frameworks m – Brian White May 19 '19 at 17:25
  • 1
    This other: [JSON.NET Framework for .NET 1.1](http://www.chiefmillso.com/blog/index.php?itemid=11) – Jimi May 19 '19 at 17:25
  • Thanks again Jimi !! But the guy never published the framework in codeplex, and also not posted a link to download the dll. :-| – Otávio Larrosa May 19 '19 at 17:33
  • Darkonekt and Brian White, I'd agree with you, but that decision cannot be mine. I've alerted our strategic manager. – Otávio Larrosa May 19 '19 at 17:37
  • 2
    It's not a `.dll`, it's a zipped file with the full project inside. You can build a library yourself. Or move on :) – Jimi May 19 '19 at 17:38
  • Could you switch to XML? I recall there was a working XML serializer in .Net 1.1. – dbc May 19 '19 at 20:32
  • Most serialisation code relies on generics for even the simplest types of collections. You can probably rework some JSON serialisation code like [the one in Unit](https://github.com/xunit/xunit/blob/5576685231e21b37341be7fa7197cde88ed7ada5/src/common/Json.cs) to not use generics but you will have a hard time. – Martin Ullrich May 19 '19 at 22:38
  • Out of context: Why does the project require 1.1? Is there a reason not to upgrade The only platform that 1.1 supports which 2.0+ don't is Windows NT 4.0.. And 2.0+ even have a lot of compatibility options (e.g. you can still get the "wrong" unicode modifier order from 1.0 in WinForms today if you really need) – Martin Ullrich May 19 '19 at 22:40

0 Answers0