title: How to serialize properties with XmlIgnore with json.net
body: <p>I have a model that i retrieve as json and as xml.</p>
  
  <p>I want to seralize different properties for Json that for xml.</p>
  
  <pre><code>[Serlializable]
  class Model
  {
       public bool? IncludeAlways {get;set;}
  
       [XmlIgnore]
       public bool? IncludeForJson {get;set;}
  
       [JsonIgnore]
       public bool? IncludeForXml {get;set;}
  }
  </code></pre>
  
  <p>Sample use:</p>
  
  <pre><code>new Model()
  {
      IncludeAlways = true,
      IncludeForJson = true,
      IncludeForXml = true
  };
  </code></pre>
  
  <p>It results the expected Xml:</p>
  
  <pre><code>&lt;Model&gt;
      &lt;IncludeAlways&gt;true&lt;/IncludeAlways&gt;
      &lt;IncludeForXml&gt;true&lt;/IncludeForXml&gt;
  &lt;/Model&gt;
  </code></pre>
  
  <p>but not the expected json</p>
  
  <p>I expected some json is like this:</p>
  
  <pre><code>{ "IncludeAlways":true, "IncludeForJson":true }
  </code></pre>
  
  <p>but i have the "IgnoreForXml" property is </p>
  
  <pre><code>{ "IncludeAlways":true }
  </code></pre>
  
  <p>Using .Net Framework 2.0 Newtonsoft JSON.Net for json and .Net Framework 2.0 standard XmlSerializer for xml. The xml is generated as a result of a WebMethod and i asume that is serialized with the standard XmlSerializer that serialize to xml.</p>