i

ASP.Net A Complete Guide

Shadow Copying

It is a technique that allows the developer to use resources (assemblies) continuously without getting affected by the execution of code in AppDomain.It enables assemblies to get updated in AppDomain without unloading the application domain. This is useful for the site that needs all the time available like asp.net site. All the assemblies are get copied into the cached. When the assemblies requested, it is referenced from the cached path only, so it won’t get locked, and it can be updated without getting interrupted.

Enabling shadow copying:

We can enable the shadow copying by adding below configuration in the web.config(.net 4) file.

Disabling shadow copying:

We can disable the shadow copying just setting the "enabled" attribute to false.

ASP.NET creates a shadow copy of the contents of a \bin folder. It will load the DLL's from the copy path only..Net will keep track of the changes and do the copy again when the content is changed.

Startup Performance:

The AppDoiman that uses the shadow copy start will take time as it will copy all the assemblies to the temporary location. It will decrease the performance of the where assemblies change frequently. While it will provide great performance where assemblies do not change frequently

How to find if the assembly gets modified or not:

Every assembly will get opened to verify its name and its strong name; also, it gets validated. It will also check that the assembly was more recently updated by comparing the date-time than the copied assembly. If so, then the assembly at the copied place will get modified.