c# - 如何在 step-into(F11) 中跳过方法

标签 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;
    }
}

在此示例中,Extentions 类具有扩展方法,并在类 ABC 中使用它,并且当进入此扩展和其他方法调用的条件时,每次我进入MakeString() 方法,我们可以跳过吗?通过使用方法属性?还是通过其他方式?

最佳答案

您可以使用 DebuggerStepThrough对此的属性。

关于c# - 如何在 step-into(F11) 中跳过方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23492763/

相关文章:

C# GetForegroundWindow() 为多个窗口返回相同的结果,EnumWindows 根本不返回那个 #

c# - 使用 Javascript 折叠 RadFileExplorer

c# - 等待方法返回 true

c# - 如何在 winforms 应用程序中连接到远程 SQL Server 数据库?

visual-studio-2008 - 为什么在 VS2008 中 F10 这么慢?

java - (Android Studio)如何仅通过我的代码进行调试?

c# - 什么 VS 调试器使增量运算符执行得比什么都不做更快?

c# - 类型接口(interface) C# 的集合

c++ - Eclipse CDT 无法调试以进入同一目录中的函数定义

visual-studio - 在反汇编 View 中进入 P/Invoke 调用