How can I find a method caller when stepping through C# in Visual Studio 2008?

Check the Call Stack window (Debug, Windows, Call Stack). Double clicking each entry there will take you to the calling statement. You can also right click on it to enable/disable showing external code items and calls from other threads.


When the breakpoint is hit, you can view the entire call stack. You can bring that window up by going through the Debug menu->Windows->Call Stack.

You can also bring it up by the shortcut Alt+Ctrl+C

EDIT: You can also right-click on a function name, and view the "Callers Graph", which will show you all the callers for your method. Alternatively, you can bring the Call Browser (by going to View->Other windows->Call Browser ) and search for your method's name.


If you can't see anything in the call stack at a user-set breakpoint, it generally means it was called from native code.

Another case where it can't get a stack: You hit Debug>Break All and the main thread is in a wait/sleep state, the debugger can have problems building the call stack. I believe the debugger uses the main thread for its implicit function evaluation.

Try attaching (or launching) the mixed-mode (native & managed) code debugger and see if that straightens it out.