How to not lock two files with Assembly.Load
<p>If I copy a file</p>

<pre><code>File.Copy(src, dst);
</code></pre>

<p>and then load the copy</p>

<pre><code>var asm = Assembly.LoadFile(dst);
</code></pre>

<p><strong>Why are <em>both</em> files locked by my process?</strong> </p>

<p>If I delete the src before I load the dst, and then recopy the dst back to the src I get my desired end result. But the delete and copy seem a little unnecessary.</p>

<pre><code>File.Copy(src, dst);
File.Delete(src);
var asm = Assembly.LoadFrom(dst);
File.Copy(dst, src);
</code></pre>

<p>Yes I am building a plugin-design application. Yes I could be using AppDomains with Shadow Copy (http://msdn.microsoft.com/en-us/library/ms404279.aspx). Yes I will have to manage my own type cache (as each assembly load will give a different type as far as my AppDomain is concerned). But these are not answers to my question.</p>

<p>Note that src and dst are strings. No other stream is opened on the files.</p>
