Hello. I'd like to know, if I have a variable,for example, a string, how to pass its value to my new app domain:
static string _str;
static void Main(string[] args) {
_str = "abc";
AppDomain domain = AppDomain.CreateDomain("Domain666");
domain.DoCallBack(MyNewAppDomainMethod);
AppDomain.Unload(domain);
Console.WriteLine("Finished");
Console.ReadKey();
}
static void MyNewAppDomainMethod() {
Console.WriteLine(_str); //want this to print "abc"
}
Thanks