如何跳过步骤中的方法(F11)

Ank*_*kar 4 c# step-into

让我们举个例子:

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;
    }
}
Run Code Online (Sandbox Code Playgroud)

在这个示例Extentions类中有扩展方法并且我在类中使用它,ABC并且在使用此扩展和其他方法调用的条件下,然后每次我在MakeString()方法中逐步进入时,我们可以跳过它吗?通过使用method attribute?或通过其他方式?

nvo*_*igt 6

您可以使用DebuggerStepThrough属性.