title: .Net 4.0 System.Xml.dll different versions?
body: <p>I was trying to use the Dispose method of the <code>XmlReader</code> but it seemed it wasn't available. After looking <a href="https://stackoverflow.com/questions/9582320/unable-to-call-dispose">around</a> on the internet, I found out that in .Net 2.0 the <code>IDisposable.Dispose</code> method was implemented explicitly, but that this was "corrected" in .Net 4.0. Indeed, when I checked the method with .Net Reflector it was exposed publicly.</p>
  
  <p>But although my project used .Net 4.0 as target framework, I still could not call the Dispose method without explicit casting the XmlReader to IDisposable.</p>
  
  <p>Then I noticed that .Net Reflector decompiled <code>C:\Windows\Microsoft.net\Framework\v4.0.30319\System.Xml.dll</code> while my project used <code>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll</code> as reference. I decompiled the latter and indeed, the <code>Dispose</code> method is still implemented explicitly in that one.</p>
  
  <p>Why are there 2 different versions of the same dll for the same version of the framework ?</p>
  
  <p>Can my Visual Studio 2010 be configured to use <code>C:\Windows\Microsoft.net\Framework\v4.0.30319\</code> instead of <code>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0</code> when referencing the framework ?</p>
  
  <p>P.S. I did not yet install the .Net 4.5 framework.</p>