简体   繁体   English

由于 UI,Visual Studio 2022 无法在 function header 上设置断点

[英]Visual Studio 2022 Unable to set breakpoint on function header due to UI

I have recently updated from Visual Studios 2019, to Visual Studios 2022我最近从 Visual Studios 2019 更新到 Visual Studios 2022

In the previous version of Visual Studios 2019, I was able to set breakpoints on single line functions, -- but simply putting the breakpoint at the function definition itself -- As shown below:在之前的 Visual Studios 2019 版本中,我能够在单行函数上设置断点,——但只需将断点放在 function 定义本身——如下所示:

Visual Studios 2019 Breakpoint on function function 上的 Visual Studios 2019 断点

However, after installing to 2022, now this space has been taken up by a new button, that is now blocking my attempt但是,安装到2022之后,现在这个空间已经被一个新按钮占用了,现在阻止了我的尝试

Visual Studio 2022 Unable to set breakpoint on function Visual Studio 2022 无法在 function 上设置断点

Is there any way to remove these new added "Implemented Members" button, or to add breakpoint overtop of them?有没有办法删除这些新添加的“实施成员”按钮,或者在它们之上添加断点?

Under Debug->Options->Text Editor->C#->Advanced在调试->选项->文本编辑器->C#->高级

If you scroll to the very bottom, and uncheck "Combine inheritance margin with indicator margin, you are now able to set breakpoints again at the function level.如果您滚动到最底部,并取消选中“将 inheritance 边距与指标边距相结合,您现在可以在 function 级别再次设置断点。

Picture of Inheritance Margin setting that can be unchecked Inheritance 可以不勾选的边距设置图片

After unchecking the thing above, now can set breakpoints at the function header, and keep the inheritance margin feature:取消勾选上述内容后,现在可以在 function header 处设置断点,并保留 inheritance 边距功能:

Now able to set breakpoint at function header现在可以在 function header 处设置断点

Pressing F9 while your cursor is on the line in question will set a breakpoint.在您的 cursor 位于相关行上时按 F9 将设置断点。 However, when the inheritance indicator is present, the breakpoint is still obscured and it's difficult to see whether it has been hit.但是,当inheritance指示符出现时,断点仍然模糊不清,很难看出它是否被命中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM