title: After calling Assembly.LoadFrom(file), file is not being released when app closes
body: <p>I use Assembly.LoadFrom to load custom dll's, but one of these dll's is maintained in my project solution and is offered with the application.</p>
  
  <p>The problem is that about every other time I try to build the project I get an error saying that it was unable to copy the newly compiled dll over the old one because it's being used by another process.</p>
  
  <p>What's the best way to handle this?  Two ideas that come to mind are:</p>
  
  <ul>
  <li>Copy the file to another location before loading it</li>
  <li>Just load the file into memory myself so I can manually close the file and then load the assembly from the in-memory copy.</li>
  </ul>
  
  <p>Both of these solutions would be reasonably easy to implement, but I'd like it even better if there was an quick/easy approach that didn't require me to change my code.</p>
  
  <p>Edit: I don't need to unload an assembly during runtime.  When the program ENDS, I need it to release its lock on the dll file.  I am perfectly aware of how AppDomains work and the pros of loading plugins into their own AppDomains, but for this particular application I'm not doing it that way.</p>