title: How can I deserialize with TypeNameHandling.Objects in Json.NET Silverlight?
body: <p>I get an exception when trying to deserialize in Silverlight. Test1 fails, while Test2 succeeds.  I've also tried TypeNameAssemblyFormat to both Simple and Full, but get same results.  Test2 can resolve the assembly, why can't Json.NET?</p>
  
  <p><strong>Update:</strong> Forgot to mention the type I'm trying to deserialize is defined in a different assembly from the silverlight assembly where the deserialization occurs.</p>
  
  <p>Both tests work in a non-silverlight .NET application.</p>
  
  <p><strong>How can I deserialize a json string that has typenames?</strong></p>
  
  <pre><code>private void Test1()
  {
      JsonSerializerSettings settings = new JsonSerializerSettings();
      settings.TypeNameHandling = TypeNameHandling.Objects;
      string json1 = "{\"$type\":\"AmberGIS.NetworkTrace.DTO.NTPoint, NetworkTrace.DTO.Assembly\",\"X\":0.0,\"Y\":0.0,\"SpatialReference\":null}";
      try
      {
          var n1 = JsonConvert.DeserializeObject&lt;NTPoint&gt;(json1, settings);
          //Error resolving type specified in JSON 'AmberGIS.NetworkTrace.DTO.NTPoint, NetworkTrace.DTO.Assembly'.
          //Could not load file or assembly 'NetworkTrace.DTO.Assembly, Culture=neutral, PublicKeyToken=null' or one of its dependencies. 
          //The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. 
          //(Exception from HRESULT: 0x80131053)
      }
      catch (Exception ex)
      {
          while (ex != null)
          {
              Debug.WriteLine(ex.Message);
              ex = ex.InnerException;
          }
      }
  }
  </code></pre>
  
  <p>This Test2 succeeds: </p>
  
  <pre><code>private void Test2()
  {
      var pnt1 = new AmberGIS.NetworkTrace.DTO.NTPoint();
      Debug.WriteLine(pnt1.GetType().AssemblyQualifiedName);
      // "AmberGIS.NetworkTrace.DTO.NTPoint, NetworkTrace.DTO.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
  
      string fullName = "AmberGIS.NetworkTrace.DTO.NTPoint, NetworkTrace.DTO.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
      var t = Type.GetType(fullName);
      var pnt2 = Activator.CreateInstance(t) as NTPoint;
  
  }
  </code></pre>