CefSharp crashing when javascript tries to parse an object containing a list sent from C#
<p>I'm using CefSharp to have a webbrowser run angularjs code inside a winforms application.</p>

<p>I am able to send c# objects to the js side and then use them if they only contain strings, ints, and so on. But when I try to send an object containing a list of values in it, CefSharp crashes when it trys to parse it on the js side.</p>

<p>An example of the c# code:</p>

<pre><code>public class TestClass
{
    public string name { get; set; }
    public string other { get; set; }
    public List&lt;int&gt; ints { get; set; } 
}
</code></pre>

<p>Working obj:</p>

<pre><code>TestClass tc = new TestClass()
{
    name = "Bobby Test",
    other = "Hello"
};
</code></pre>

<p>Obj causing crashes:</p>

<pre><code>TestClass tc = new TestClass()
{
    name = "Bobby Test",
    other = "Hello",
    ints = new List&lt;int&gt;(){0,1}
};
</code></pre>

<p>How I pass to the js code:</p>

<pre><code>browser.RegisterJsObject("testObj", tc);
</code></pre>

<p>My angular code setting it up for use:</p>

<pre><code>$scope.$watch(function ()
{ return window.testObj },
function () {
    $scope.someField = window.testObj;
});
</code></pre>

<p>I tried doing a JsonConvert.SerializeObject on the object before passing it but it ended up just being an empty object on the js side.</p>

<p><strong>EDIT - Solution</strong></p>

<p><em>C# to JS:</em></p>

<p>Changed TestClass to:</p>

<pre><code>TestClass tc = new TestClass()
{
    name = "Bobby Test",
    other = "Hello",
    ints = new int[] {0,1}
};
</code></pre>

<p>And it works correctly with the code above without having to call any serializing or deserializing methods directly.</p>

<p><em>JS to C#:</em></p>

<p>Although it wasn't in my question:</p>

<p>I am passing an object to the js side with a callback function to c#, the callback function accepts a serialized string from the js side which I then deserialize on the c# side.</p>