Step through a program backwards after an Exception has occurred - Visual Studio

In the Ultimate versions of Visual Studio 2010 you can use Inellitrace to go back in the execution, as Dan Puzey mentioned.

However, in any version of Visual Studio you can still get a lot of information just from the call stack. It doesn't only show the calls that lead up to the current position, by double clicking on points in the Call Stack window you can jump to the point in the code where each method was called. The state of the stack is preserved, so you can even still see the values of local variables in the calling method.


If you have VS2010 Ultimate, the "Intellitrace" functionality allows you to do exactly that. It basically logs a huge amount of execution data (up to and including every method call & parameter made) and allows you to step back in time to examine variable values at those points.