如何跳过步进法(F11)
本文关键字:F11 何跳过 步进 | 更新日期: 2023-09-27 18:01:49
让我们看看下面的例子:
public static class Extensions
{
public static string MakeString(this object obj)
{
if (obj == null) return string.Empty;
return obj.ToString();
}
}
public class ABC
{
public void Method()
{
object obj = default(object);
//Implemention goes here..
// Here every time in step into navigate to MakeString() Method.
if(IsValid(obj.MakeString()))
{
//Operations..
}
}
private bool IsValid(string str)
{
//Check if string is valid or not..
return true;
}
}
在这个例子中,Extentions
类具有扩展方法,我在ABC
类中使用它,当使用这个扩展和其他方法调用进入状态时,每次我进入MakeString()
方法,我们可以跳过它吗?用method attribute
?还是通过其他方式?
你可以使用DebuggerStepThrough属性。