So I am trying to learn about AppDomains using C#.
I created a simple Console App that waits for user input.
Then I created a simple WinForms app that has this code in the click event
of a button.
AppDomain domain = AppDomain.CreateDomain("MyDomain");
domain.ExecuteAssembly("C:\\ConsoleApp1.exe");
AppDomain.Unload(domain);
label1.Text = "Done";
It works as expected when I let the console app do its thing and input
whatever (which closes the console app and returns control to the WinForms
App.
But if I just close the console app the WinApp closes right away also.
I imagine that if I am using a separate exe and running it in an AppDomain
of a WinApp, if the application running in the AppDomain has an issue I
would rather my WinApp not close also.
Can anyone share AppDomain info with me or point me to some good info that
will explain the error of my ways?
Greg