After posting the question I discovered it is a setting you can pass in to the App.config
file. What you need to do is set the configuration settings <appDomainManagerType>
and <appDomainManagerAssembly>
and point it at a 2nd assembly that contains a AppDomainManager.
Config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
<appDomainManagerType value="DomainManager.ShadowDomainManager" />
<appDomainManagerAssembly
value="DomainManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</runtime>
</configuration>
Manager:
using System;
namespace DomainManager
{
public class ShadowDomainManager : AppDomainManager
{
public override void InitializeNewDomain(AppDomainSetup appDomainInfo)
{
base.InitializeNewDomain(appDomainInfo); //Currently does not do anything.
appDomainInfo.ShadowCopyFiles = "true";
}
}
}
Doing this will cause the initial domain to load with ShadowCopyFiles
set to true.