Newtonsoft.Json adds ellipsis (...) at the middle of a serialized array
<p>This is a very weird behaviour of <code>Newtonsoft.Json</code>'s serialization functionality. I've tried almost everything (for instance I didn't go ahead and use .NET Reflector to walk step by step through the <code>Newtonsoft.Json.dll</code> assembly's algorithms).</p>

<h2>Symptoms</h2>

<p>The situation is as follows:</p>

<p>I have a small POCO which holds 4 string properties:</p>

<pre><code>public class MyPoco {
    public string op { get; set; }
    public string left { get; set; }
    public string right { get; set; }
    public string result { get; set; }
}
</code></pre>

<p>I create an array of 618 <code>MyPoco</code> instances:
<a href="https://i.stack.imgur.com/tmynq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tmynq.png" alt="enter image description here"></a></p>

<p>The resulting <em>json</em> is always broken at the middle by an ellipsis:
<a href="https://i.stack.imgur.com/0cmNJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0cmNJ.png" alt="enter image description here"></a></p>

<p>The exact anatomy of the resulting string is this:</p>

<ul>
<li>The first part of the string is the successful serialization of the first 156 <code>MyPoco</code> instances</li>
<li>The second part of the string is literally 3 dots (which also breaks the Json syntax - which is actually a good thing) followed by the last half of the <code>MyPoco</code> instance who's 0 based index is 466</li>
<li>The third part of the string is the successful serialization of the last 152 <code>MyPoco</code> instances</li>
</ul>

<p>So basically, to wrap it up:</p>

<ul>
<li><code>Newtonsoft.Json</code> is successfully serializing the first 156 items of my array (indices 0 through 155)</li>
<li>It also successfully serializes the last 152 items (indices 467 through 617)</li>
<li>It also successfully writes the opening and closing square brackets (representing the Array) at the very beginning and at the very end of the resulting string</li>
<li>At the very middle of this string, it adds and ellipsis which cuts the string in half, after what would appear to be a leading bunch of 15,000 "healthy" characters and before the trailing bunch of 15,000 "healthy" characters</li>
</ul>

<h2>Problem</h2>

<p>I don't know what to do. I could go on and use <code>JavaScriptSerializer</code> but I don't want to lose trust in <code>Newtonsoft.Json</code>.</p>

<p>That is the main issue.</p>

<p>It feels like it should've crashed with a comprehensive exception, but instead it silently fails, which could leave to serious complications in production apps.</p>

<p>I've looked everywhere for "Max Buffer Size" like settings and couldn't find anything more than the already notorious "Max Depth" setting which is not the case here since I have a 3 layer tree (with primitive strings on the deepest layer).</p>

<p>Has anyone ever experienced such a weird behaviour of <code>Newtonsoft.Json</code>?</p>

<h2>Further information</h2>

<p>I used both 8.0.2 and 7.0.1 Nuget package versions (I skipped 8.0.1).
Both versions exhibit the same symptoms.</p>

<p>I'm targeting .NET 4.6 and we're talking about an empty Console App (I replicated the symptoms in the cleanest way possible).</p>

<h2>EDIT #1</h2>

<p>Here's a snapshot of the ellipsis as seen right there, in the Visual Studio debugger:</p>

<p><a href="https://i.stack.imgur.com/tvRTC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tvRTC.png" alt="enter image description here"></a></p>