title: How do I add a Dictionary<string,string> to an existing JSON.Net's JObject?
body: <p>I've got a JObject (using JSON.Net) that I created by parsing some JSON text. I'm directly manipulating, adding keys at the top level of this JObject. I have no problems when the value I'm adding is a string:</p>
  
  <pre><code>json["newkey"] = "New Value"; // works
  </code></pre>
  
  <p>But I'll be damned if I can figure out how to add a Dictionary, e.g.:</p>
  
  <pre><code>Dictionary&lt;string,string&gt; dict = new Dictionary&lt;string,string&gt;();
  dict["one"] = "1";
  dict["two"] = "2";
  json["dict"] = dict;          // fails
  </code></pre>
  
  <p>I've done quite a bit of googling and reading the JSON.Net docs, but everything seems oriented towards reason JSON text into a JObject, or writing .NET objects as JSON text using serialization. Or using some fancy LINQ statements to do all kinds of things with complex objects...</p>
  
  <p>I've tried these and none have worked:</p>
  
  <pre><code>json["dict"] = new JObject(dict);
  json["dict"] = new JObject((Dictionary&lt;string,string&gt;)dict);
  json["dict"] = new JArray(dict);  // desperation sets in :)
  json["dict"] = (JObject)dict;     // please dear god let this work
  </code></pre>
  
  <p>Most of the latest errors I encounter are:</p>
  
  <p><strong>Could not determine JSON object type for type System.Collections.Generic.KeyValuePair`2[System.String,System.String].</strong></p>