title: Deserializing F# Map by Json.Net
body: <p>I have one simply question: Is it possible to parse F# Map type from <a href="/questions/tagged/json" class="post-tag" title="show questions tagged 'json'" rel="tag">json</a>? Because when I try it (With <code>F# Map&lt;string, string&gt;</code>), it is easy to serialize and it looks how it have to, but when I try to deserialize it is throwing an exception.</p>
  
  <pre><code>Newtonsoft.Json.JsonSerializationException: Unable to find a default constructor to use for type Microsoft.FSharp.Collections.FSharpMap`2[System.Int32,System.String]. Path '1', line 2, position 7.
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewDictionary (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonDictionaryContract contract, System.Boolean&amp; createdFromNonDefaultConstructor) [0x00000] in &lt;filename unknown&gt;:0 
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00000] in &lt;filename unknown&gt;:0 
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00000] in &lt;filename unknown&gt;:0 
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) [0x00000] in &lt;filename unknown&gt;:0
  </code></pre>
  
  <p>And it is deserializing from classic:</p>
  
  <pre class="lang-js prettyprint-override"><code>Map.ofList [ ("1", "one"); ("2", "two"); ("3", "three") ]
  </code></pre>
  
  <p>The resulting JSON looks like C# dictionary</p>
  
  <pre class="lang-js prettyprint-override"><code>{
    "1": "one",
    "2": "two",
    "3": "three"
  }
  </code></pre>
  
  <p>It is serializing without settings (Only indentation). So is it possible to serialize this, or is there some working workaround?</p>
  
  <p>Thanks for answer</p>