简体   繁体   English

Visual Studio 2012 / C#中断了代码执行,没有设置断点

[英]Visual Studio 2012/C# breaks code execution, no breakpoint set

I'm having a problem in Visual Studio 2012/C# which is driving me crazy. 我在Visual Studio 2012 / C#中遇到了问题,这让我发疯了。 I have a particular line of code in a C# file with NO breakpoint set. 我在C#文件中有一行特殊的代码,没有设置断点。 Every time this line should be executed the debugger interrupts the execution of my code like a breakpoint was set. 每次执行此行时,调试器都会中断我的代码执行,就像设置了断点一样。 The only difference i noticed is the arrow on the left hand side, indicating the current step. 我注意到的唯一区别是左侧的箭头,表示当前步骤。 Usually this arrow is yellow (when a breakpoint is set). 通常此箭头为黄色(设置断点时)。 In my case it is grey. 就我而言,它是灰色的。

I have been searching for a solution but did not find anything useful to this. 我一直在寻找解决方案,但没有发现任何有用的东西。 I tried deleting all breakpoints, build project, rebuild project, clean project and it still appears. 我尝试删除所有断点,构建项目,重建项目,清理项目,它仍然出现。

Does anyone have the same problems and found a solution this? 有没有人有同样的问题,并找到了解决方案?

normal arrow: 正常箭头: 正常的箭头

arrow in my case: 在我的情况下箭头: 在我的情况下箭头

This line of code is currently executing, it calls something else, eg native code or .NET internal code and an exception happens there. 这行代码当前正在执行,它调用其他东西,例如本机代码或.NET内部代码,并且在那里发生异常。 You can see both arrows in the call stack window: 您可以在调用堆栈窗口中看到两个箭头:

箭头在调用堆栈窗口中

Perhaps you need to turn on "Show external code". 也许你需要打开“显示外部代码”。

If you can't see the exception dialog, usually you can show it like this: 如果您看不到异常对话框,通常可以这样显示:

在VS中显示异常

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

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