Relative Is it possible to use the default AppDomain application to use shadow copies of certain assemblies? , it describes a working solution for activating shadow copying in the standard AppDomain application for a specific directory.
This basically means using these simple methods:
AppDomain.CurrentDomain.SetShadowCopyPath(aDirectory);
AppDomain.CurrentDomain.SetShadowCopyFiles();
But since the methods used here are marked as deprecated, I wondered what is now the right way to achieve the same. A warning message indicates:
Please learn to use AppDomainSetup.ShadowCopyDirectories instead
AppDomain has a member of this type called SetupInformationthat can lead you to this simple implementation
AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories = aDirectory;
AppDomain.CurrentDomain.SetupInformation.ShadowCopyFiles = "true";
, .
, , AppDomainSetup ?