In your UnhandledException code UnhandledException not a single AppDomain , because if you call a delegate using BeginInvoke() , any exception that is BeginInvoke() during its execution is EndInvoke() and then EndInvoke() when you call EndInvoke() , which you do not.
If you call EndInvoke() :
start.EndInvoke(start.BeginInvoke(null, null));
or execute the delegate synchronously:
start();
You get similar results: UnhandledException main domain is raised.
If instead, you follow what the documentation says and start a new thread using the Thread class:
new Thread(Nested1ThreadStart).Start();
UnhandledException from Nested1 and the main application domain.
So, to answer your question: the documentation is correct. Your code is incorrect. When you call a delegate asynchronously using BeginInvoke() , you should always call EndInvoke() later.
svick
source share