i'm new in appdomain concept. It stated here that shadow copy creates a copy of the assembly you are referencing but when I check my ShadowCopyDirectories, it is empty.
Here's my code:
AppDomainSetup sandboxDomainSetup = new AppDomainSetup();
sandboxDomainSetup.ApplicationBase = @"D:\Testing\AppDomainTestProject\MainUI\bin\Debug";
sandboxDomainSetup.ShadowCopyFiles = "true";
string appData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
string tempfolder = Path.Combine(appData, "TestAppDomain"); //C:\ProgramData\TestAppDomain
if (!Directory.Exists(tempfolder))
{
Directory.CreateDirectory(tempfolder);
}
sandboxDomainSetup.ShadowCopyDirectories = tempfolder;
sandbox = AppDomain.CreateDomain("MyAppDomain", null, sandboxDomainSetup);
Assembly sandboxAssembly = Assembly.LoadFrom(assemblyPath.ToString());
var instance = sandbox.CreateInstance(sandboxAssembly.GetName().Name, sandboxAssembly.GetTypes().FirstOrDefault().FullName);
if (instance != null)
{
object obj = instance.Unwrap();}
Did I missed out anything? Thank you