title: NewtonSoft.json base class serialization
body: <p>When I updated the concerned Newtonsoft.json.dll from .NET 3.5 to .NET 4.5 then base class is not Serializing. Before updating, the base class was serializing.</p>
  
  <pre><code>public class MyBaseClass
  {
      public string BaseProp1 { get; set; }
      public string BaseProp2 { get; set; }
  }
  
  [DataContract]
  public class MyDerivedClass : MyBaseClass
  {
      [DataMember]
      public DateTime DerProp1 { get; set; }
      public string DerProp2 { get; set; }
  }
  
  
  class Program
  {
      static void Main(string[] args)
      {
          MyDerivedClass derc = new MyDerivedClass();
          derc.BaseProp1 = "BaseProp1";
          derc.DerProp1 = DateTime.Now;
          derc.BaseProp2 = "BaseProp2";
          derc.DerProp2 = "DerProp2";
  
          Newtonsoft.Json.Converters.IsoDateTimeConverter conv = new Newtonsoft.Json.Converters.IsoDateTimeConverter();
          conv.DateTimeFormat = "MM/dd/yyyy HH:mm:ss zzz";
  
          string jsonSerializedObject = JsonConvert.SerializeObject(derc, conv);
  
      }
  }
  </code></pre>
  
  <p>The program does not serialize members of the base class. The reason for that is that I have not specified the [DataContract] in the base class. I need ALL the members to be serialized.
  Problems:</p>
  
  <ol>
  <li>I can not remove [DataContract] from the derived class as it is extensively used by WCF.</li>
  <li>I do not want to add [DataContract] to the base class as there are a LOT of members.</li>
  </ol>
  
  <p>What is the best way to go ahead?</p>