title: Type is not serializable because it's not public?
body: <p>I have a public class that won't serialize properly. When attempted, the following exception is thrown:</p>
  
  <blockquote>
    <p>The data contract type 'MyProject.MyClass' is not serializable because it is not public. Making the type public will fix this error. Alternatively, you can make it internal, and use the InternalsVisibleToAttribute attribute on your assembly in order to enable serialization of internal members - see documentation for more details. Be aware that doing so has certain security implications.</p>
  </blockquote>
  
  <p>My class <strong>is</strong> public, though:</p>
  
  <pre><code>[DataContract]
  public class MyClass
  {
      [DataMember]
      public string Name { get; set; }
  
      [DataMember]
      private int Count;
  
      public MyClass()
      {
          Name = string.Empty;
          Count = 0;
      }
  }
  </code></pre>
  
  <p>Why am I getting this exception when the class is clearly public?</p>