Exemplo n.º 1
0
 public void Worker()
 {
     for (int i = 0; i < 2000; i++)
     {
         try {
             String s = _worker.ToString() + ":" + i.ToString();
             Console.WriteLine(s);
             AppDomain app       = AppDomain.CreateDomain(s);
             MainApp   remoteapp = (MainApp)app.CreateInstanceAndUnwrap("appdomainstress", "MainApp");
             remoteapp.Action();
             AppDomain.Unload(app);
         } catch (Exception e) {
             Console.WriteLine(e);
             Environment.Exit(100);
         }
     }
 }