Cannot create/shadow copy when that file already exists

The .Net Framework has a feature called Shadow Copy. Shadow copy is enabled on every appdomain created by ASP.NET by default. By default assemblies loaded will be copied to a shadow copy cache directory, and will be used from that location. Why does ASP.Net do this? So the original file is not locked and can be modified. An interesting error I have ran into intermittently when running ASP.Net apps with the debugger is ‘Cannot create/shadow copy when that file already exists‘ I’m still not sure why this happens only on occasion, as I can often clean my solution, then reload a web app and it will work fine then. But if you are getting it frequently enough for it to affect your work, you can add the following to your app’s web.config or the master .Net web.config:

<system.web>
   <hostingEnvironment shadowCopyBinAssemblies="false" />
</system.web>
   Thanks Rana Faisal Munir
About these ads

9 Responses to “Cannot create/shadow copy when that file already exists”


  1. 1 Darwin May 9, 2008 at 5:06 pm

    thanks, I did what you say, and this functioned satisfactorily

  2. 3 sadiq September 18, 2008 at 12:13 pm

    thanx… it helped me a lot

  3. 4 ahmed ali khan November 26, 2008 at 11:12 am

    thanx allllllllot….
    Jeeta rahe rana…..

  4. 5 Tjaart May 19, 2010 at 10:27 am

    Thanks! This error was driving me nuts.

  5. 6 mostafa May 24, 2010 at 1:26 pm

    u saved my A$$ Buddy :D
    Cheers.

  6. 7 YK August 9, 2012 at 8:51 am

    Thanks. It just happened suddenly.

  7. 8 iphone repair malaysia May 6, 2013 at 1:03 am

    It’s awesome in favor of me to have a website, which is beneficial in favor of my experience. thanks admin


  1. 1 Cannot create/shadow copy when that file already exists | Web Site Developement & Marketing Strategies Trackback on May 11, 2009 at 2:18 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





Follow

Get every new post delivered to your Inbox.

%d bloggers like this: