title: The XML element named 'name' from namespace references distinct types
body: <p>Please help. I've got an error while deserializing the data from the server,</p>
  
  <blockquote>
    <p>The top XML element 'Name' from namespace '' references distinct types
    Object1.LocalStrings and System.String. Use XML attributes to specify
    another XML name or namespace for the element or types.</p>
  </blockquote>
  
  <p>I have a class ObjectType which contains properties Name and <code>List&lt;SupportedIp&gt;</code>. SupportedIp class contains property Name also. Please refer to my code below:</p>
  
  <pre><code>[XmlRootAttribute("SupportedIp", Namespace = "http://test.com/2010/test", IsNullable = false)]
  public partial class SupportedIp
  {[XmlElementAttribute(Namespace = "")]
      public string Name
      {
          get;
          set;
      } .... }
  
  
  [GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
  [SerializableAttribute()]
  [DebuggerStepThroughAttribute()]
  [DesignerCategoryAttribute("code")]
  [XmlTypeAttribute(Namespace = "http://test.com/2010/test")]
  [XmlRootAttribute("ObjectType", Namespace = "http://test.com/2010/test", IsNullable = false)]
  public partial class ObjectType
  {
  
      /// &lt;remarks/&gt;
      [XmlElementAttribute(ElementName = "", Namespace = "")]
      public LocalStrings Name
      {
          get;
          set;
      }
  
      /// &lt;remarks/&gt;
      [XmlArrayAttribute(ElementName = "Supportedip", Namespace = "")]
      [XmlArrayItemAttribute(IsNullable = false, Namespace = "")]
      public List&lt;Supportedip&gt; Supportedip
      {
          get;
          set;
      }
  }
  </code></pre>
  
  <p>When application reaches to <strong>XmlSerializer</strong> part, error  displays. Ive seen somewhat related post but there's no concreate answer.</p>