找出我的应用程序当前在Visual Studio的调试模式下运行的代码行

问题描述:

当我使用Visual Studio在调试模式下运行应用程序时,有没有办法找出目前正在处理的代码行?这意味着,有没有一种工具类似于设置断点,但是您不必设置断点 - 您可以随时查找执行代码行的任何时间点。

When I'm running an app in debug mode with Visual Studio, is there a way that I can find out what line of code is currently being processed? By this I mean, is there a tool that works kind of like setting a breakpoint, but you don't have to set a breakpoint - you can just find out at any point in time what line of code is being executed?

这样做的原因是,有时您可能需要在应用程序中调试间歇性挂起。如果您在调试模式下运行,并且您的应用程序挂起,立即找到上一次处理的代码行将是有用的,而无需通过设置断点或跟踪调用提前计划。

The reason for this, is that sometimes you may want to debug intermittent hangs in your app. If your running in debug mode, and your app hangs, it would be useful to immediately find out what line of code it last processed, without having to plan ahead by setting breakpoints or trace calls.

按暂停按钮(||)。