https://bugzilla.novell.com/show_bug.cgi?id=639381
https://bugzilla.novell.com/show_bug.cgi?id=639381#c1 Adam Fletcher <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Adam Fletcher <[email protected]> 2011-03-23 01:37:26 UTC --- I am experiencing the same situation with my code. Running identical code on a windows machine (Windows 7) produces a different result than when it is run on a Mac (Mac OS X 10.6.5) On Windows 7 using mono/.net 3.5 it gives me this result: [{"Suit":0},{"Suit":1},{"Suit":2}] On Mac OS X 10.6.5 using mono/.net 3.5 it gives me this result: [{"__type":"Card:#JsonTest","Suit":0},{"__type":"Card:#JsonTest","Suit":1},{"__type":"Card:#JsonTest","Suit":2}] Listed below is a console application that can be run to show the results listed above. In order to run this you need to include two references: System.Runtime.Serialization and System.ServiceModel.Web. using System; using System.Collections.Generic; using System.Runtime.Serialization.Json; using System.IO; using System.Text; namespace JsonTest { class MainClass { public static void Main(string[] args) { Hand hand = new Hand(); hand.Add(new Card { Suit = 0 }); hand.Add(new Card { Suit = 1 }); hand.Add(new Card { Suit = 2 }); string json; DataContractJsonSerializer ser = new DataContractJsonSerializer(hand.GetType()); using (MemoryStream ms = new MemoryStream()) { ser.WriteObject(ms, hand); json = Encoding.Default.GetString(ms.ToArray()); } Console.WriteLine(json); } } public class Card { public int Suit { get; set; } } public class Hand : List<Card> { } } -- 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. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
