在visual studio中,有没有办法退一步看看之前执行的几行是什么? [英] In visual studio, is there a way to step back to see what the few lines executed before were?
问题描述
在visual studio中,有没有办法退一步看看之前执行的几行是什么?我在我的代码中遇到了一个未处理的异常,我想做的是后退(不重新执行),这样我就可以看到调用抛出异常的方法的类/方法.这是在 C# 中
In visual studio, is there a way to step back to see what the few lines executed before were? I hit an unhandled exception in my code, and what I would like to do is step back (without re-executing) so I could see the class/method that called the method that threw the exception. This is in C#
推荐答案
Debug -> Windows -> Call Stack (Ctrl + Alt + C is default bindings (I think))
会显示执行的历史,你可以双击事件去定义,但是你不能在代码中退回
但是你可以把你的黄色小箭头拖到代码中的另一个点重新执行一些代码,同样这不会改变已经执行的内容
Will show you the history of execution, you can double click events to go to definition, however you cannot step back in code
But you can drag your little yellow arrow to another point in the code to re-execute some code, again this will not change what has already been executed
这篇关于在visual studio中,有没有办法退一步看看之前执行的几行是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!