473,395 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,395 developers and data experts.

What is Meant by Shadow Copying - in .NET

111 100+
While developing web application I came across build error: "Cannot create/shadow copy 'your assembly info here' when that file already exists". I was not quite sure what is shadow copy is in .net. From name we can guess that its shadowing or helping in taking requests for some thing else. And its correct.

Why this was introduced in asp.net?
If we are developing/updating/enhancing any production applications, without having to stop and restart the web server we can update the server with latest files and the application will not stop or error out at that moment, instead all the requests will be processed with the old files/dlls and any new requestes will be processed with the new dlls/files updated in the server. For this to work shadowing concept was introduced.

The way that this works is that ASP.NET makes a shadow copy of the contents of the \bin directory, and loads the DLLs from the copy. ASP.NET monitors the \bin directory for changes, and repeats the shadow copy when the contents change.

Impact on server by keeping it ON?
It does take time, and if you have a large number of DLLs, or very large DLLs, the shadow copy process can potentially impact application startup and restart performance.

So in some situations, you might want to turn off the shadow copy process. To do this, add the following to your ASP.NET 2.0 web.config file:

<hostingEnvironment shadowCopyBinAssemblies="false" />

Impact of keeping it OFF?
While this will reduce performance overhead associated with shadow copying the contents of the \bin directory, do keep in mind that using this configuration option will result in the DLLs being locked when the app is running. So if you need to update a DLL, you will need to take the application offline or stop the process before you can do so.

Forgot to say you if you get "Cannot create/shadow copy 'your assembly info here' when that file already exists" error, by setting the shadowCopyBinAssemblies="false" we can get rid of this error. We can also remove the error by cleaning the solution (Solution->Clean).

Hope it helps some one.

Thanks
Bharath Reddy VasiReddy
Apr 7 '10 #1
1 7996
Couldnt agree more with that, very attractive article
Nov 22 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bill Rust | last post by:
I have a component that needs to access files which exist in the same directory as the DLL containing the component itself. To determine the component's installation directory, I'm using...
0
by: Mr 071 | last post by:
I am trying to use shadow copying provided by the framework, but I am not able to get it to work. More specifically, after a new app domain is created and the assembly loaded in it, it is still not...
0
by: surya | last post by:
Hi, I need to enable shadow copying network share folder assemblies. Currently if the path is given as the network share folder path, shadow copying is not enabled. Should something special be...
2
by: Alex | last post by:
Is this correct: 1. When the first request for an application on the virtual directory comes in and ASP.NET worker process creates an AppDomain for that particular application, it copies the...
4
by: Barry Kelly | last post by:
I'm designing an application framework which will, amongst other things, live in an assembly hosted in the ASP.NET worker process, servicing webservice requests. Here's the scenario: APPFX is...
0
by: Damien Anselmi | last post by:
I am using the CompileAssemblyFromSource method of an ICodeCompiler instance to dynamically compile an assembly used by a Web Application. The assembly may be recompiled any number of times during...
2
by: Oenone | last post by:
I have an application which loads plugin DLLs from various directories on the local disk. To avoid problems with the DLLs being locked by IIS, I have modified my code so that it copies the DLLs to...
4
by: Michael Nemtsev | last post by:
Use Win2003 Server and VS 2003. When I'm trying to debug COM+ lib, I've stumble over ShadowCopying feature, when my dll being copied in temporary folder, and I can't step in my dll. No breakpoits...
4
by: santoshramancha | last post by:
hi all. can anyone give the source code for shallow copying?
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.