0

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?

Nzall
  • 3,439
  • 5
  • 29
  • 59
  • I hear two things: 1) enter the debugger when you press a key, and then 2) run it slowly so you can watch it. For (1) you can use the "pause" button. (If you land in a system call, just press shift-F11 till you come out.) For (2) you can just press F11 continually, or F10 when you get to a system call. OTOH if you really want to find out what takes time, just pause a few times and look at the call stack ([*this method*](http://stackoverflow.com/a/378024/23771)). Your disappointment with profilers is not surprising. – Mike Dunlavey Oct 22 '14 at 14:49

2 Answers2

1

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.

Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66
  • This looks like the best solution. I haven't tried it yet, but it is close to what I want. – Nzall Nov 18 '14 at 15:40
0

This is a ridiculously complicated requirement. I'm not saying it's a bad idea, and it would be amazing if such a thing was possible, but I very much doubt it's available anywhere. I've never heard of anything like this as a VS feature or even as a plugin.

demoncodemonkey
  • 11,730
  • 10
  • 61
  • 103