Related:
If a method throws an exceptions that is called by the ThreadPool.QueueUserWorkItem method where will the exception be thrown? or will it just be eaten?
I mean it will never be thrown on the calling thread right?
Related:
If a method throws an exceptions that is called by the ThreadPool.QueueUserWorkItem method where will the exception be thrown? or will it just be eaten?
I mean it will never be thrown on the calling thread right?
You'll have to catch the exception inside the callee, otherwise you'll get a an ThreadException, i believe.
Unhandled exceptions will bring down the app in .Net 2.0 or higher. The exception from QUWI code will not be caught or transferred to another thread.
See e.g. http://www.codinghorror.com/blog/archives/000216.html
NO, the exception will never propagate to another thread. It will eventually crash the thread, and be caught by the runtime. At this point the runtime raises the AppDomain.UnhandledException event where the exception can be observed.
You can read more about this here.
The exception will crash your application if is not caught inside your thread callback (except for ThreadAbortException and AppDomainUnloadedException that are swallowed). Note that in .NET 1.1 all exceptions were swallowed. The behavior was changed in .NET 2.0.
I found this link: http://msdn.microsoft.com/en-us/library/ms228965.aspx