title: How to programmatically choose a constructor during deserialization?
body: <p>I would like to deserialize a <code>System.Security.Claims.Claim</code> object serialized in the following way:</p>
  
  <pre><code>{
      "Issuer" : "LOCAL AUTHORITY",
      "OriginalIssuer" : "LOCAL AUTHORITY",
      "Type" : "http://my.org/ws/2015/01/identity/claims/mytype",
      "Value" : "myvalue",
      "ValueType" : "http://www.w3.org/2001/XMLSchema#string"
  }
  </code></pre>
  
  <p>What I get is a <code>JsonSerializationException</code>:</p>
  
  <blockquote>
    <p>Unable to find a constructor to use for type
    System.Security.Claims.Claim. A class should either have a default
    constructor, one constructor with arguments or a constructor marked
    with the JsonConstructor attribute.</p>
  </blockquote>
  
  <p>After some investigation I finally understand the meaning of <em>one</em> in the above message: The JSON deserializer cannot find the right constructor as there are - in the case of the <code>Claim</code> type - <strong>multiple constructors with arguments</strong> (although there exists a constructor with arguments matching exactly the above properties).</p>
  
  <p>Is there a way to tell the deserializer which constructor to choose without adding the <code>JsonConstructor</code> attribute to that mscorlib type?</p>
  
  <p>Daniel Halan has solved this issue with a <a href="http://blog.halan.se/post/Deserializing-objects-with-non-default-constructors-in-JSONNET.aspx">patch to Json.NET a few years ago</a>. Is there a way to solve this without modifying Json.NET these days?</p>