Visual Studio 2008 ASP。Net调试僵尸断点在被删除后返回

时间:2023-01-18 09:40:32

In Visual Studio 2008 while debugging an ASP.Net website I set a breakpoint in the codebehind page. I refresh the page or submit to call the method, the breakpoint is hit. Then I delete the breakpoint and continue execution. I make a change to the codebehind page and save it. I submit or refresh again and the deleted breakpoint is back! It is hit again, and I delete it again. I have tried delete, disable, nothing works it keeps coming back if I make a change to the page. It is extremely annoying and unproductive. The only way I have found to make the breakpoint permanently go away is to use the Debug menu Delete all breakpoints item, which is obviously less than ideal. I have been able to reproduce this on other developers machines also. What is going on here? Is this by design? Is it a bug in VS? How do I keep these zombie breakpoints from resurrecting?

在Visual Studio 2008中调试一个ASP。我在codebehind页面中设置了一个断点。我刷新页面或提交调用方法,断点被击中。然后删除断点并继续执行。我对后面的代码页做了更改并保存它。我再次提交或刷新,删除的断点又回来了!它再次被点击,我再次删除它。我试过删除,禁用,什么都没用如果我对页面做了修改它就会回来。这是极其恼人和徒劳的。我发现使断点永久消失的唯一方法是使用Debug菜单删除所有断点项,这显然不太理想。我还可以在其他开发人员的机器上复制它。这是怎么回事?这是通过设计吗?它是VS中的bug吗?如何防止这些僵尸断点复活?

5 个解决方案

#1


2  

It's because its child breakpoints persist: MSDN article.

这是因为它的子断点是持久的:MSDN文章。

Your options are:
- Stop your debug session, then remove the breakpoint by clicking its red glyph.
- Find the breakpoint in the Breakpoint Window list and delete it from there.
- Use a macro to clean up child breakpoints between debug sessions, then remove by clicking the glyph.[1] (Quirky, but feels good when it works.)
- Use a macro to delete a breakpoint on the currently selected line.[2]

您的选项是:-停止您的调试会话,然后通过单击其红色字形删除断点。-在断点窗口列表中找到断点并从中删除。-使用宏来清理调试会话之间的子断点,然后通过单击符号删除。[1](古怪,但当它工作的时候感觉很好)-使用一个宏来删除当前选定行的断点。[2]

#2


3  

It's probably a bug. Either use Delete All Breakpoints (Shift+F9) or try deleting the breakpoint in stopped (not Run) mode.

它可能是一个错误。要么使用删除所有断点(Shift+F9),要么尝试在停止(而不是运行)模式中删除断点。

#3


2  

It's as @sgiffinusa's link describes: it's the difference between a pending and a bound breakpoint. Before the debugger is attached, it's a pending breakpoing, once the debugger is attached, it may have more than one piece of generated code accessing it, and the debugger binds a breakpoint to each path into that code. I don't get it...but that's what seems to happen. :)

正如@sgiffinusa的链接所描述的:它是挂起断点和绑定断点之间的区别。在附加调试器之前,它是一个挂起的断点,一旦附加了调试器,它可能有不止一块生成的代码访问它,调试器将断点绑定到每个路径到该代码中。我不明白……但这似乎就是事实。:)

One work around that seems to work for me is to, instead of toggling the breakpoint with the mouse by clicking the margin, use the F9 key (or whatever you have it mapped to,) to toggle the breakpoint off, and then press F9 again to toggle it back on, and then F9 once more to be rid of the dang thing forever.

工作之一,似乎在为我工作,而不是切换断点用鼠标点击,使用F9键(或不管你把它映射到)切换断点,然后按F9再切换回来,然后再次F9永远摆脱讨厌的事情。

I've no idea why that works, but it does in this office.

我不知道为什么会这样,但是在这个办公室。

#4


1  

I've had this problem too. If you stop debugging (click stop) before you delete the breakpoint, it should go away permanently.

我也遇到过这个问题。如果在删除断点之前停止调试(单击stop),那么它应该永久消失。

#5


1  

I think this is by design.

我认为这是故意的。

Remove a breakpoint in debug mode and it's temporary. Remove a breakpoint in design mode and its permanent.

在调试模式下删除断点,这是临时的。在设计模式和它的永久中移除断点。

#1


2  

It's because its child breakpoints persist: MSDN article.

这是因为它的子断点是持久的:MSDN文章。

Your options are:
- Stop your debug session, then remove the breakpoint by clicking its red glyph.
- Find the breakpoint in the Breakpoint Window list and delete it from there.
- Use a macro to clean up child breakpoints between debug sessions, then remove by clicking the glyph.[1] (Quirky, but feels good when it works.)
- Use a macro to delete a breakpoint on the currently selected line.[2]

您的选项是:-停止您的调试会话,然后通过单击其红色字形删除断点。-在断点窗口列表中找到断点并从中删除。-使用宏来清理调试会话之间的子断点,然后通过单击符号删除。[1](古怪,但当它工作的时候感觉很好)-使用一个宏来删除当前选定行的断点。[2]

#2


3  

It's probably a bug. Either use Delete All Breakpoints (Shift+F9) or try deleting the breakpoint in stopped (not Run) mode.

它可能是一个错误。要么使用删除所有断点(Shift+F9),要么尝试在停止(而不是运行)模式中删除断点。

#3


2  

It's as @sgiffinusa's link describes: it's the difference between a pending and a bound breakpoint. Before the debugger is attached, it's a pending breakpoing, once the debugger is attached, it may have more than one piece of generated code accessing it, and the debugger binds a breakpoint to each path into that code. I don't get it...but that's what seems to happen. :)

正如@sgiffinusa的链接所描述的:它是挂起断点和绑定断点之间的区别。在附加调试器之前,它是一个挂起的断点,一旦附加了调试器,它可能有不止一块生成的代码访问它,调试器将断点绑定到每个路径到该代码中。我不明白……但这似乎就是事实。:)

One work around that seems to work for me is to, instead of toggling the breakpoint with the mouse by clicking the margin, use the F9 key (or whatever you have it mapped to,) to toggle the breakpoint off, and then press F9 again to toggle it back on, and then F9 once more to be rid of the dang thing forever.

工作之一,似乎在为我工作,而不是切换断点用鼠标点击,使用F9键(或不管你把它映射到)切换断点,然后按F9再切换回来,然后再次F9永远摆脱讨厌的事情。

I've no idea why that works, but it does in this office.

我不知道为什么会这样,但是在这个办公室。

#4


1  

I've had this problem too. If you stop debugging (click stop) before you delete the breakpoint, it should go away permanently.

我也遇到过这个问题。如果在删除断点之前停止调试(单击stop),那么它应该永久消失。

#5


1  

I think this is by design.

我认为这是故意的。

Remove a breakpoint in debug mode and it's temporary. Remove a breakpoint in design mode and its permanent.

在调试模式下删除断点,这是临时的。在设计模式和它的永久中移除断点。