What does the ShadowCopyFiles property do in appdomain?

I know when you set to true, it will shadow copy files. But what does a shadow copy mean and why do we need shadow copies of files?

+7
shadow-copy
source share
1 answer

The shadow copy creates a copy of the assembly you are referencing.

The reason for this is that .Net (or rather Windows) cannot unload (some) assemblies into a single loaded process. Because of this, you can never replace the assembly without shutting down the entire process, because the file remains locked by the OS.

However, if you have a shadow copy of .Net really uses this to load your classes, you can replace the original DLL file, and only the shadow copy (which no one "cares" about) remains blocked.

This is especially important in some environments (for example, on a web server, where you obviously do not want to shut down the entire server in order to launch a new version of a web application).

+12
source share

All Articles