title: ASP.Net cannot create/shadow copy
body: <p>I get this error repeatedly when developing ASP.Net applications:</p>
  
  <pre><code>  Cannot create/shadow copy 'XXXXX' when that file already exists
  </code></pre>
  
  <p>Where XXXXX is a random DLL. Typically the DLL is one of the DLLs from Microsoft's Enterprise Library, but it varies. </p>
  
  <p>It's really random, and it's very frustrating. I will go hours without getting the error, and then get this error every 10-20 minutes. </p>
  
  <p>I've seen several solutions. For instance, <a href="https://stackoverflow.com/questions/281145/asp-net-hostingenvironment-shadowcopybinassemblies">this question</a>. I've tried using Clean Solution option, and I've also simply restarted my local IIS. However, it still occurs at the same random but persistent frequency. </p>
  
  <p>I've also seen many people mention using this option in the config file:</p>
  
  <pre><code>&lt;hostingEnvironment shadowCopyBinAssemblies="false" /&gt;
  </code></pre>
  
  <p>However, others have mentioned it being problematic, and it should definitely not be used in production. </p>
  
  <p>So, should I just give up and try the shadowCopyBinAssemblies option? (And make sure not to copy this change to other environments.) Am I the only one who gets this issue that often?</p>
  
  <p><em>Note:</em> I am using Visual Studio 2008. </p>