为什么Visual Studio的摊位,而调试? [英] Why does Visual Studio stall while debugging?

查看:138
本文介绍了为什么Visual Studio的摊位,而调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,当我调试一个C#应用程序,我会打一个破发点,当我尝试继续,步骤,或跳入,只是什么都不做。黄线突出显示当前行消失,但它永远不会到达下一行。该应用程序仍在冻结就像我在一个断点,我可以做什么,但击中停止调试按钮,并重新启动。这不会发生所有的时间,但一旦它开始于一个应用程序,它似乎总是之后,对于该应用程序发生。我发现,添加以下code之前的类声明修复该应用程序中的问题,但我很好奇,为什么发生这种情况。

Sometimes, while I am debugging a c# application, I will hit a break point and when I try to continue, step or step into, it just does nothing. The yellow line highlighting the current line goes away, but it never reaches the next line. The app is still frozen like I am on a breakpoint and I can do nothing but hit the stop debugging button and restart. This doesn't happen all the time, but once it starts on an app it seems like it always happens after that for that app. I have found that adding the following code just before the class declaration "fixes" the problem for that app, but am very curious as to why this is happening.

[System.Diagnostics.DebuggerDisplay("Form1")]

其他详细信息: 我还没有发现任何一种模式,以什么特定的行不结冰时。大多数应用程序我写的使用线程,所以有一个像样的机会,这是一个线程中的每一次发生的事情。

Additional details: I have not noticed any kind of pattern as to what the particular line does when it freezes. Most of the apps I write use threading, so there is a decent chance this is happening within a thread every time.

推荐答案

我见过的拖延问题,其中的调试器试图评估在自动/本地窗口中显示的变量。如果评估复杂那么它可以引起显著档位

I've seen stalling problems where the debugger is trying to evaluate the variables shown in the Auto/Local windows. If the evaluation is complicated then it can cause significant stalls.

您可以通过工具打开自动评估过。|选项,它确实有很大的不同。

You can turn the auto-evaluation off through Tools|Options and it does make a big difference.

这篇关于为什么Visual Studio的摊位,而调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆