如何在C#代码行的中间设置断点? [英] how to set a breakpoint at the middle of a line of C# code?
本文介绍了如何在C#代码行的中间设置断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,我有以下代码
Variable.Method1().Method2();
我想在Method1()之后和Method2()之前设置断点。我可以在Visual Studio中这样做吗?怎么做?谢谢。
I want to set the breakpoint after Method1() and before Method2(). Can I do so in visual studio? How to do it? Thanks.
推荐答案
那行不通,但这会:
var result1 = Variable.Method1();
result1.Method2(); //set breakpoint here
否则,在Method2的第一行代码处设置断点,然后就可以继续使用那一行代码。
Otherwise set a breakpoint at the first line of code on Method2 and then you can keep using that one line of code.
这篇关于如何在C#代码行的中间设置断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文