Search code examples
c#.netexceptionappdomainunhandled

How do .NET AppDomains keep the hosted process alive?


Say I have two AppDomains within a .NET/CLR process.

One of the AppDomains crashes due to a unhandled exception.

Would the other AppDomain still be running fine? What if the default AppDomain crashed otherwise?

I am just wondering on what keeps a process alive. Since AppDomains are completely seperate entities I assume the default AppDomain could crash and other AppDomains could continue?

Not even my C# book explicitly mentions what happens...


Solution

  • I'd assume that if any of the domains you have created from your main thread crash, you will be fine. However, if your "entry domain" crashes, the others die as well.