title: DataContractSerializer - change namespace and deserialize file bound to old namespace
body: <p>I have a data class that is serialized with the <code>DataContractSerializer</code>.  The class uses the <code>[DataContract]</code> attribute with no explicit <code>Namespace</code> declaration.  As such, the namespace in the resulting xml file is generated based on the namespace of the class.</p>
  
  <p>The class basically looks like this:</p>
  
  <pre><code>namespace XYZ
  {
     [DataContract]
     public class Data
     {
        [DataMember(Order = 1)]
        public string Prop1 { get; set; }
  
        [DataMember(Order = 2)]
        public int Prop2 { get; set; }
     }
  }
  </code></pre>
  
  <p>...and the resulting xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Data xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/XYZ"&gt;
     &lt;Prop1&gt;StringValue&lt;/Prop1&gt;
     &lt;Prop2&gt;11&lt;/Prop2&gt;
  &lt;/Data&gt;
  </code></pre>
  
  <p>Now I want to change the namespace of the class (actually remove it) by changing the <code>[DataContract]</code> attribute to <code>[DataContract(Namespace = "")]</code>.  However, once I do this any file previously serialized with the original namespace with no longer deserialize.  I receive the following exception:</p>
  
  <p><code>Error in line 1 position XXX. Expecting element 'Data' from namespace ''.. Encountered 'Element'  with name 'Data', namespace 'http://schemas.datacontract.org/2004/07/XYZ'.</code></p>
  
  <p>This makes perfect sense.  I changed the namespace.  I'm ok with that.  However, it seems like there must be a way to tell the <code>DataContractSerializer</code> to go ahead and deserialize that data even though the namespaces don't match.</p>