title: StackOverflowException in my JsonConverter class when using [JsonConverter] attribute
body: <p>I have a test class which I am trying to serialize:</p>
  
  <pre><code>public class Testing
  {
      private string _name;
      private string _firstname = "firstname";
      public string _lastname;
      private DateTime _datenow = DateTime.Now;
      public DateTime _birthdate = DateTime.Now;
  
      public string Name { get { return _name; } set { _name = value; } }
  }
  </code></pre>
  
  <p>I am using a custom <code>JsonConverter</code> to handle the serialization for the test class:</p>
  
  <pre><code>public class TestingConverter : JsonConverter
  {
      private Type[] _types = new Type[] { typeof(Testing)};
  
      /// &lt;summary&gt;
      /// Writes the JSON representation of the object.
      /// &lt;/summary&gt;
      /// &lt;param name="writer"&gt;The &lt;see cref="JsonWriter"/&gt; to write to.&lt;/param&gt;
      /// &lt;param name="value"&gt;The value.&lt;/param&gt;
      /// &lt;param name="serializer"&gt;The calling serializer.&lt;/param&gt;
      public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
      {
          try
          {
              JToken t = JToken.FromObject(value); //This is what i want to do
              //rest of code
          }
          catch (Exception ex)
          {
              Console.Write(ex.Message);
              throw;
          }
      }
  
      public override bool CanRead
      {
          get 
          { 
              return false;
          }
      }
  }
  </code></pre>
  
  <p>If I perform the serialization by passing the converter to the <code>JsonSerializer</code> object it works fine:</p>
  
  <pre><code>Testing t = new Testing();
  t._lastname = "USER LAST NAME";
  JsonSerializer p = JsonSerializer.CreateDefault();
  p.Converters.Add(new TestingConverter());
  
  using (StreamWriter file = File.CreateText("output.json"))
  using (JsonTextWriter writer = new JsonTextWriter(file))
  {
      p.Serialize(writer, t);
  }
  </code></pre>
  
  <p>But, if I instead mark my test class with a <code>[JsonConverter]</code> attribute:</p>
  
  <pre><code>[JsonConverter(typeof(TestingConverter))]
  public class Testing
  {
      private string _name;
      private string _firstname = "firstname";
      public string _lastname;
      private DateTime _datenow = DateTime.Now;
      public DateTime _birthdate = DateTime.Now;
  
      public string Name { get { return _name; } set { _name = value; } }
  }
  </code></pre>
  
  <p>and serialize like this: </p>
  
  <pre><code>Testing t = new Testing();
  t._lastname = "USER LAST NAME";
  JsonSerializer p = JsonSerializer.CreateDefault();
  
  
  using (StreamWriter file = File.CreateText("output.json"))
  using (JsonTextWriter writer = new JsonTextWriter(file))
  {
     p.Serialize(writer, t);
  }
  </code></pre>
  
  <p>my <code>TestingConverter</code> class is called, but it goes into a recursive loop at the <code>JToken.FromObject(value)</code> method and finally crashes with a <code>StackOverflowException</code>.</p>
  
  <p>Can anyone tell me why this is happening?  What am I missing?</p>