将多组断点保存为不同的配置文件 - Visual Studio

Saving multiple sets of breakpoints as different profiles - Visual Studio

Visual Studio2017 是否有内置功能可以在不同的配置文件中保存多组断点,可以轻松切换。

UseCase:在大型项目中,有时需要只关注一组flow-1,然后切换回另一组 flow-2,其中每个流都有自己的一组断点,您不希望将 flow-1 的断点设置为命中.

The MSDN link given in the SO answer , is no longer valid.

And anything better than import/export solution? This approach has one limitation - "Breakpoint Import depends on the line number where you have set your breakpoint earlier. If your line number changed the breakpoint will set on the previous line number only, so you will get breakpoints on unexpected lines."

您可以使用断点另存为选项来保存断点windows

它将保存为 XML 文件。您可以随时随地放置此文件。这样你就可以看到你曾经使用过的断点。

引用link: Import or Export breakpoints in visual studio

在 Visual Studio Breakpoints window 中,您可以为 flow-1 或 flow-2 标记断点:

然后,要快速启用或禁用一组断点,您可以搜索 flow-1 或 flow-2 并单击 Enable or disable all与当前搜索条件匹配的断点 按钮。