I'm having some trouble with serializing a ObservableCollection of Lines (Shape). I'm developing for Windows RT and I'm using JSON.NET v5.02. I'm getting the following exception for the code below:
ObservableCollection<Line> lines;
//some code
string linesString = JsonConvert.SerializeObjectAsync(lines); // problem
An exception of type
Newtonsoft.Json.JsonSerializationException
occurred in mscorlib.dll but was not handled in user codeAdditional information: Error getting value from 'X1' on 'Windows.UI.Xaml.Shapes.Line'.
If there is a handler for this exception, the program may be safely continued.
Is this a bug and is there a possible workaround?