I am creating a AppDomain using the below code
String pa = @"C:\Users\user\AppData\Local\Temp\2\db5fjamk.xnl";
System.IO.Directory.CreateDirectory(pa);
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; //f:\projectpath\out\debug-i386-unittest\UnitTests
setup.ApplicationName = string.Concat(AppDomain.CurrentDomain.FriendlyName, DateTime.UtcNow.Ticks); //UnitTestAdapter: Running test636559691791186101
setup.DynamicBase = pa;
Evidence evidence = AppDomain.CurrentDomain.Evidence;
_Domain = AppDomain.CreateDomain(setup.ApplicationName, evidence, setup);
But _Domain.DynamicDirectory property does not exist. https://msdn.microsoft.com/en-us/library/system.appdomain.dynamicdirectory(v=vs.110).aspx clearly says the AppDomainSetup.DynamicBase is used.
What could be the reason executing in vstest.console.exe changes the behavior with App Domains. Is there a work around.
_Domain.DynamicDirectory
? I don't see it in your code at all. – Redmanvar path = _Domain.DynamicDirectory;
and tell us exactly what you see. – Baxie