I am learning about AppDomains using C#.
I created a simple Console App that waits for user input called ConsoleApp.
Then I created a simple WinForms app called WinApp that has this code in the
click event
of a button.
AppDomain domain = AppDomain.CreateDomain("MyDomain");
domain.ExecuteAssembly("C:\\ConsoleApp.exe");
AppDomain.Unload(domain);
label1.Text = "Done";
So, WinApp represents the main program and the ConsoleApp represents the
program the AppDomain is created for and runs in.
It works as expected when I let the console app do its thing and input
whatever so ConsoleApp closes as expected and returns control to WinApp.
But if I just close ConsoleApp (by clicking the X in the controlbox of the
console window) the console app closes, but nothing gets returned to the
WinApp which then closes right away also.
Greg