rickgaribay.net

Space shuttles aren't built for rocket scientists, they're built for astronauts. The goal isn't the ship, its the moon.
posts - 303, comments - 180, trackbacks - 35

My Links

News

Where's Rick?


AgileAlliance deliver:Agile 2019- 4/29
Desert Code Camp, PHX - 10/11
VS Live Austin, TX - 6/3
VS Live SF - 6/17


About Me
Hands on leader, developer, architect specializing in the design and delivery of distributed systems in lean, agile environments with an emphasis in continuous improvement across people, process and technology. Speaker and published author with 18 years' experience leading the delivery of large and/or complex, high-impact distributed solutions in Retail, Intelligent Transportation, and Gaming & Hospitality.

I'm currently a Principal Engineer at Amazon, within the North America Consumer organization leading our global listings strategy that enable bulk and non-bulk listing experiences for our WW Selling Partners via apps, devices and APIs.

Full bio

Note: All postings on this site are my own and don’t necessarily represent the views of my employer.



Check out my publications on Amazon Kindle!





Archives

Post Categories

Published Works

Ctrl + Alt + E - The Way to Debug for Me

One of the best things I love about consulting is how much I learn from my clients.

I have been in out in Salt Lake City for the last few weeks working on a WCF SOA project for a client and have been stepping through lots of code. And I'm not just talking about regular .NET code either- I'm talking two instances of Visual Studio 2005 up and running, one exercising a test harness/unit test and the other hosting a WCF service. I love the ability to step through a client, watch the call cross the process boundary and step into the service code. Visual Studio 2005 is truly a marvel of an IDE!

One of the things I learned from the lead .NET developer (Sam "Samwise" Walker)  this week is that VS 2005 supports the ability to control how the debugger interacts with exceptions. I have always debugged as follows:

1. Step through the code
2. If an exception is thrown, the debugger chokes at the top-most level in the call chain
3. I then trace the exception back to the original site

This approach is ardous because by default the debugger will capture unhandled exceptions, but since exceptions bubble up to the top of the call stack, you are always left dealing with the outer exception.

The solution is to set VS 2005 up to intercept exceptions as they are thrown, the first time an exception is thrown. This is contrary to the default behavior where the debugger will only catch the last unhandled exception as it winds it's way up the call stack.

To enable this feature, in VS 2005, click Ctrl + Alt + E. An Exceptions window will appear. You will notice that for "Common Language Runtime Exceptions", the right-most column, "User Unhandled" is checked. This is the default behavior. Click the checkbox next to "Common Language Runtime Exceptions" labeled "Thrown". From this point forward, you will capture the very first exception as it is initially thrown.

Hopefully, this tip will save you some time in your next debugging session.

Thanks Sam!

Print | posted on Friday, October 05, 2007 1:22 PM | Filed Under [ Misc. Visual Studio ]

Comments have been closed on this topic.

Powered by: