c# - 在 Visual Studio 2012 中设置多个断点

标签 c# visual-studio debugging visual-studio-2012 breakpoints

<分区>

我想在所有 Convert.ToInt32 行设置断点。

我尝试将所有 Convert.ToInt32 替换为 System.Diagnostics.Debugger.Break(); Convert.ToInt32 但它不起作用,因为一些 Convert.ToInt32 方法是参数。所以我写了一个正则表达式替换,它在所有 Convert.ToInt32 行的开头插入 System.Diagnostics.Debugger.Break();。这似乎可行,但有什么简单的方法可以做到这一点吗?

ps:我认为“调试 -> 新断点 -> 在函数处中断”不适用于系统方法。

更新: 我写了一个小代码

class Program
{
    private static void Main(string[] args)
    {
        int test = System.Convert.ToInt32("x");

        System.Console.Write(test);
    }
}

我已经更改了“工具 -> 选项 -> 调试”设置 Tools -> Options -> Debugging

但它仍然不工作ing enter image description here

最佳答案

关闭调试配置中的“Enable Just My Code”设置并Enable .net framework source stepping。现在您可以添加 Break at Function 选项

关于c# - 在 Visual Studio 2012 中设置多个断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16997343/

相关文章:

c++ - 在 Visual Studio 2010 中混合使用异常处理模型会产生什么后果?

java - Eclipse java调试: source not found

python - 在 Pycharm 中的 for 循环内调试列表理解

c# - 实现接口(interface) C#

c# - 在 Blend 2015 中使用 3D OBJ 文件

c# - "foreach"VS "List<T>.Foreach"...哪个赢了

c# - 以编程方式创建 sqlite 数据库(如果它不存在)?

visual-studio - 我可以将加载项添加到 Visual Studio 菜单的 "analyze"部分吗?

c# - 调试时有效,运行时失败?

c# - Umbraco 媒体服务创建媒体