什么ShadowCopyFiles财产的AppDomain呢?财产、ShadowCopyFiles、AppDomain

2023-09-04 08:39:16 作者:寂念流年

我知道,当你设置为true,将卷影副本的files.But什么卷影副本的意思是,为什么我们要卷影复制文件?

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

推荐答案

卷影复制创建您引用的组件的副本。

Shadow copy creates a copy of the assembly you are referencing.

这样做的原因是,净(更准确的Windows)无法卸载,一旦加载的过程中(部分)组件。正因为如此,你永远无法替代的组件,而无需关闭整个过程,因为该文件仍然锁定操作系统。

The reason for this is that .Net (more exactly Windows) cannot unload (some) assemblies within a process once loaded. Because of this you could never replace an assembly without shutting down the entire process because the file remains locked by the OS.

不过,如果你有一个卷影副本的.Net实际使用的加载你的课程,你可以替换原来的.dll文件,并只卷影副本(也没人关心有关)保持锁定。

However if you have a shadow copy .Net actually uses that to load your classes you can replace the original .dll file and only the shadow copy (that nobody 'cares' about) stays locked.

这是在某些环境中尤为重要(如Web服务器,你显然不希望关闭整个服务器只运行一些网络应用程序的新版本)。

This is especially important in some environments (e.g. a webserver where you obviously don't want to shut down the entire server just to run a new version of some web-application).

 
精彩推荐
图片推荐