Relating to Can I make the default AppDomain use shadow copies of certain assemblies?, it describes a working solution to activate shadow copying within the default AppDomain for a specific directory.
Basically it says to use these simple methods:
AppDomain.CurrentDomain.SetShadowCopyPath(aDirectory);
AppDomain.CurrentDomain.SetShadowCopyFiles();
But because the methods used here are marked as obsolete I was wondering what is now the correct way to accomplish the same. The warning message hints to:
Please investigate the use of AppDomainSetup.ShadowCopyDirectories instead
An AppDomain has a member of this type called SetupInformation
which might bring you to this straightforward implementation
AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories = aDirectory;
AppDomain.CurrentDomain.SetupInformation.ShadowCopyFiles = "true";
Unfortunately this has no effect. So the question is, is there a way to alter the AppDomainSetup of the current appdomain to activate shadow copying ?