title: Replace assembly in ASP.net application
body: <p>I am trying to (mostly to see if it can be done) replace a dll-file in a ASP.net application. And just to make things more interesting, the file I'm trying to replace, is the same file that will (to a certain degree at least) hold the logic of how to replace it.</p>
  
  <p>I've been able to replace almost every file in the project, except for the dll-files that are running, and currently I'm a bit stuck.</p>
  
  <p>First of all, this is not something that should be performed often, so scalability is not an issue (doesn't matter if it takes up to a minute or so). Secondly, I do not want to use a Windows Service.</p>
  
  <p>The only way (I have yet to try, but will start experimenting with) to achieve this (without using a Windows Service) is to create an application that is launced by the ASP.net app. Then the ASP.net app shuts itself down (using something like <code>HttpRuntime.UnloadAppDomain();</code>), hopefully this will unlock the files. Then the application swaps out the dll-files. However I'm thinking that there must be some other possible way to achieve this.</p>
  
  <p>So what I'm asking is basically for ideas on how to solve this problem, because I'm about to run out of mine.</p>