[Mono-bugs] [Bug 667058] New: "Invalid JSON primitive: null" when using Mono. Works fine with .Net
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Jan 25 12:51:12 EST 2011
https://bugzilla.novell.com/show_bug.cgi?id=667058
https://bugzilla.novell.com/show_bug.cgi?id=667058#c0
Summary: "Invalid JSON primitive: null" when using Mono. Works
fine with .Net
Classification: Mono
Product: Mono: Class Libraries
Version: 2.8.x
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: System
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: milkplus at yahoo.com
QAContact: mono-bugs at lists.ximian.com
Found By: Development
Blocker: Yes
using System;
using System.Web.Script.Serialization;
// mono doesn't like objects that only have keys with null values
// if you add another property with a non-null value, it works
// works in both cases with .NET
namespace Bug
{
public class Program
{
static int Main(string[] args)
{
String jsonStr = "{ \"a\" : { \"b\" : null } }";
JavaScriptSerializer jss = new JavaScriptSerializer();
Object jsonObject = jss.Deserialize<object>(jsonStr);
Console.WriteLine(jsonObject.ToString());
return 0;
}
}
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list