Geeks With Blogs
Sean Carpenter Thoughts on Development

Now that the release of VS2005 and the .NET Framework 2.0 is imminent, I'm able to justify more time at work for reviewing its impact.  This list of breaking changes for 2.0 is definitely useful in that regard.

I think one of the most important changes is the fact that unhandled exceptions will now always end a process (search for “Unhandled exceptions will always be fatal to a process”on this page).  The 1.1 behavior was that unhandled exceptions on threads other than the main thread would not end a process.  I ran into this twice while working on Windows Services that used background threads.  I know I should have been catching the exceptions, but it was still design/debug time and that error handling wasn't present yet.  The symptom I experienced was that the service would run for a while, but then stop polling a message queue for any more messages.  The problem was that the polling was done in response to the Elapsed event of a non auto-reset timer - when the processing was complete, the timer was re-enabled.  When an exception was raised in the processing (which took place on a background thread as a result of the timer Elapsed event) the processing stopped before getting to the re-enable code.  So essentially the service was dead, since it was no longer polling the message queue.  This change will prevent this kind of bug from creeping in.

[Via James Manning]

Posted on Monday, October 24, 2005 9:47 AM .NET Programming | Back to top


Comments on this post: .NET Framework 2.0 Breaking Changes

# Unhandled exceptions will always be fatal to a process under .NET Framework 2.0
Requesting Gravatar...
This from the "CLR Run-Time Breaking Changes" page on MSDN (here).  As noted in the breaking changes...
Left by Jeff Stong on Dec 20, 2005 7:51 AM

Comments have been closed on this topic.
Copyright © Sean Carpenter | Powered by: GeeksWithBlogs.net