Search code examples
debuggingvisual-studio-2013profilingbreakpoints

Can VS 2013 show me a visual representation of the path my code takes as I take it?


When I'm debugging, Visual studio allows me to place a breakpoint anywhere, which in turn allows me to step through the code. However, I sometimes encounter a problem where what I THINK is the first method called, actually isn't the first method called. For example, I THINK the onclick for my button is called first, but actually, it's another method on the Master page, or even something in my Global.asax, which then changes a variable, which then changes the code path my code takes, which then breaks my code.

I'm looking for something that's basically: press this button in Visual Studio while debugging, then do something that causes a postback (or otherwise something to happen in the backend), and Visual studio then automatically goes to the very first method called and starts stepping through the code at a steady but understandable pace (longer method calls notwithstanding, and only going through my own code, not anything in library references) until you tell it to stop.

I know this sounds like profiling, but it's actually not. Profiling just passively gathers data while you do your thing, and shows it afterwards. There's no live feedback on what happens, and I can't make heads nor tails of the result of the profiler. In fact, last time I used the built-in VS profiler, one of my top 3 intensive methods was the profiler itself, if I read it correctly.

Ideally, what I want is something that looks and feels like an automatic debugger, something that goes F11 every .5 seconds, but skips external DLLS.

Does such a thing exist?


Solution

  • Runtime Flow extension (developed by me, 30-day trial) can show you paths the code takes in real time. Thought it is separate from VS debugging and requires some manual configuration for ASP.NET projects.