title: Json.NET and generic dictionaries
body: <p>It seems impossible to (de-)serialize a <em>generic</em> dictionary using Json.NET out of the box.</p>
  
  <pre><code>class KeyClass
  {
      public KeyClass(string p1, string p2) { prop1 = p1; prop2 = p2;}
      public string prop1 { get; set; }
      public string prop2 { get; set; }
  }
  
  class ValueClass
  {
      public ValueClass(string pa, string pb) { propA = pa; propB = pb;}
      public string propA { get; set; }
      public string propB { get; set; }
  }
  
  ...
  
  Dictionary&lt;KeyClass, ValueClass&gt; d = new Dictionary&lt;KeyClass, ValueClass&gt;();
  d.Add(new KeyClass("k1", "k2"), new ValueClass("v1", "v2"));
  d.Add(new KeyClass("k3", "k4"), new ValueClass("v3", "v4"));
  string json = JsonConvert.SerializeObject(d);
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>{"ConsoleApplication1.KeyClass":{"propA":"v1","propB":"v2"},
   "ConsoleApplication1.KeyClass":{"propA":"v3","propB":"v4"}}
  </code></pre>
  
  <p>where I expected something like:</p>
  
  <pre><code>{{"prop1":"k1","prop2":"k2"}:{"propA":"v1","propB":"v2"},
   {"prop1":"k3","prop2":"k4"}:{"propA":"v3","propB":"v4"}}
  </code></pre>
  
  <p>So <code>ToString()</code> is called on the key (KeyClass). (an override that generates json doesn't help: escapes the json and just doesn't feel right).</p>
  
  <p>Is it possible to write a CustomCreationConverter for this case?<br>
  Is this a <em>hard</em> limitation of json.NET?<br>
  If so, do other libraries support this?  </p>