title: Trouble deserialising xml file using DataContractSerializer
body: <p>It's been awhile since i've used <code>DataContractSerializer</code> and i'm having a little trouble deserializing a xml file.</p>
  
  <p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;SoftwareLicense xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;</code></p>
  
  <p>The error i'm getting is:</p>
  
  <p><code>{"Error in line 1 position 117. Expecting element 'SoftwareLicense' from namespace 'http://schemas.datacontract.org/2004/07/Solentim.Modules.Licensing.Activation'.. 
  Encountered 'Element'  with name 'SoftwareLicense', namespace ''. "}</code></p>
  
  <pre><code>[DataContract(Name = "SoftwareLicense")]
  public class SoftwareLicense : ISoftwareLicense
  {
      ...
  }
  </code></pre>
  
  <p>I've tried specifying the namespace which also doesn't work.</p>
  
  <pre><code>var serializer = new DataContractSerializer(typeof(SoftwareLicense));
  
  using (var stream = new FileStream(filename, FileMode.Open, FileAccess.Read))
  {
      using (var reader =
                  XmlDictionaryReader.CreateTextReader(stream, new XmlDictionaryReaderQuotas()))
      {
          return (SoftwareLicense) serializer.ReadObject(reader);
      }
  }
  </code></pre>
  
  <p>The namespace of the file has recently changed and an interface added to the class. I've resolved all other issues i just can't seem to get around this one.</p>
  
  <p>I prefer to use the DatacontractSerializer as the class now has interface properties and XMLSerializer won't deserialise it </p>