我已经编写了以下代码来尝试在另一个appdomain中执行代码,但是如何测试它是否实际在其他appdomain中执行?
AppDomain a = AppDomain.CreateDomain("Test");
CompilerParameters cp1 = new CompilerParameters();
string program1 = "using System; public class A{ public A(){}}";
ObjectHandle handle = a.CreateInstanceFrom(Assembly.GetExecutingAssembly().Location, "DOTNETCOMPILERa.RommelClass");
RommelClass test = (RommelClass)handle.Unwrap();
CompilerResults cr = test.test(program1, cp1);
AppDomain.Unload(a);