title: What is the right way to set shadow copying for the default AppDomain
body: <p>Relating to <a href="https://stackoverflow.com/q/1373199/1684064">Can I make the default AppDomain use shadow copies of certain assemblies?</a>, it describes a working solution to activate shadow copying within the default AppDomain for a specific directory.</p>
  
  <p>Basically it says to use these simple methods:</p>
  
  <pre><code>AppDomain.CurrentDomain.SetShadowCopyPath(aDirectory);
  AppDomain.CurrentDomain.SetShadowCopyFiles();
  </code></pre>
  
  <p>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: </p>
  
  <blockquote>
    <p>Please investigate the use of AppDomainSetup.ShadowCopyDirectories instead</p>
  </blockquote>
  
  <p>An AppDomain has a member of this type called <code>SetupInformation</code> which might bring  you to this straightforward implementation</p>
  
  <pre><code>AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories = aDirectory;
  AppDomain.CurrentDomain.SetupInformation.ShadowCopyFiles = "true";
  </code></pre>
  
  <p>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 ?</p>