简体   繁体   English

Visual Studio 2010 挂在跟踪点上

[英]Visual Studio 2010 hangs on trace point

The Problem:问题:
Whenever I try to break or set a Trace-point in the debugger, our application and visual studio freezes completely.每当我尝试在调试器中中断或设置跟踪点时,我们的应用程序和 Visual Studio 就会完全冻结。 After detaching the debugger the application continues.分离调试器后,应用程序继续。

This problem is probably related to WPF.这个问题很可能与WPF有关。 We have migrated our WinForm application to WPF.我们已将 WinForm 应用程序迁移到 WPF。 Since then this problem occurs.从那以后这个问题就出现了。 But I'm not able to find the specific part of the code which causes the problem.但是我无法找到导致问题的代码的特定部分。 I have already rolled back hundreds of commits but without success.我已经回滚了数百次提交,但没有成功。

It might also be related to the UI thread.它也可能与 UI 线程有关。 If the breakpoint is set somewhere away from the UI logic the application will not freeze or it will not freeze as often as it does somewhere in the UI Thread.如果断点设置在远离 UI 逻辑的某处,应用程序将不会冻结或不会像 UI 线程中的某处那样经常冻结。

[ Edit: ] [编辑: ]
I use Windows 7. 64bit with Visual Studio 2010我使用 Windows 7. 64 位和 Visual Studio 2010

[ Update: ] [更新: ]
When Visual studio hangs, and i try to detach before the breakpoint is displayed, the Message "Unable to detach from one or more processes. All outstanding func-evals have not completed" .当 Visual Studio 挂起并且我尝试在显示断点之前分离时,消息“无法与一个或多个进程分离。所有未完成的 func-eval 尚未完成” But i have disabled all func evaluation in the debugging options.但是我在调​​试选项中禁用了所有 func 评估。 I think my problem is caused by a func_evaluation which can not complete or which runs into a timeout.我认为我的问题是由无法完成或超时的 func_evaluation 引起的。

Is there a way to see on which func_evaluation visual studio is hanging?有没有办法看到哪个 func_evaluation 视觉工作室挂了?

Example:例子:

class SomeUiViewPresenterExample
{
   private Timer m_Timer;

public void Init()
{
    m_Timer = new Timer();
    m_Timer.Elapsed += ElapsedFoo();
    m_Timer.AutoReset = false;
    m_Timer.Interval = 200;
}

private void ElapsedFoo(object sender, ElapsedEventArgs elapsedEventArgs)
{
    // there is no code inside this method
    // On the next line a trace point with "---> ElapsedFoo called" will freeze the debugger
}

What I have already tried: (without success)我已经尝试过的:(没有成功)

  • enable / disable the host process启用/禁用主机进程
  • tried to debug x86 and x64 processes尝试调试 x86 和 x64 进程
  • launched visual studio with /SafeMode使用 /SafeMode 启动视觉工作室
  • NGEN update NGEN更新
  • disabled "property evaluation and other implicit function calls" in Debugging options在调试选项中禁用“属性评估和其他隐式函数调用”
  • disabled symbol servers禁用符号服务器
  • disabled symbol loading禁用符号加载
  • deleted WPF font cache删除了 WPF 字体缓存
  • Marked several UI elements with 'DebuggerDisplay("some text without expression")'用 'DebuggerDisplay("some text without expression")' 标记了几个 UI 元素

( Ticket Microsoft Connect ) ( 票 Microsoft Connect )

Probably related problem:可能相关的问题:

Because our application uses .NET Remoting to communicate with another process, my problem my be something similar as here .因为我们的应用程序使用 .NET Remoting 与另一个进程进行通信,所以我的问题与此处类似。 I have placed all registrations to remoted events in a own Task, but without success.我已将所有对远程事件的注册放在自己的任务中,但没有成功。

Debugger Output from debugged visual studio:来自调试的 Visual Studio 的调试器输出:

I have attached a debugger to visual studio and have observed some exceptions, (80010005)我已将调试器附加到 Visual Studio 并观察到一些异常, (80010005)

but I have no idea whether they are relevant for my problem or not:但我不知道它们是否与我的问题相关:

(18d8.1708): C++ EH exception - code e06d7363 (first chance)
(18d8.1708): C++ EH exception - code e06d7363 (first chance)
..... // snip
(18d8.18dc): **Unknown exception - code 80010005 (first chance)
..... // 20 seconds freeze until breakpoint hit in IDE

(18d8.18dc): Unknown exception - code 80010005 (first chance)
(18d8.18dc): C++ EH exception - code e06d7363 (first chance)
ModLoad: 365f0000 36665000 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\mcee.dll

// after continue execution debugger and debugged process freezes forever

(18d8.18dc): Unknown exception - code 80010005 (first chance)
ModLoad: 00000000`02b90000 00000000`02c1c000 C:\Windows\SysWOW64\UIAutomationCore.dll
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)

The more I look at this, the more I suspect it's because you're not using the WPF timer.我看的越多,我就越怀疑这是因为您没有使用 WPF 计时器。 If you try to use the regular Timer class rather than the WPF Dispatcher timer, you run the risk of trying to update the UI on a non-ui thread - which could potentially be the cause of your problem (Since the DataContext is part of the UI technically).如果您尝试使用常规 Timer 类而不是 WPF Dispatcher 计时器,则会冒着尝试在非 ui 线程上更新 UI 的风险 - 这可能是导致问题的原因(因为 DataContext 是UI技术上)。

More info here:更多信息在这里:

DispatcherTimer vs a regular Timer in WPF app for a task scheduler DispatcherTimer 与 WPF 应用程序中用于任务调度程序的常规计时器

You can use the windebug tool from this below url to better debugging and sort it out the solution您可以使用下面这个url中的windebug工具来更好地调试和整理解决方案

http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx

Thanks for your hints.谢谢你的提示。 Finally I have installed VS 2012 and the debugger now behaves as normal.最后,我安装了 VS 2012,调试器现在运行正常。 It seems there is really a bug / performance issue in the visual studio 2010 debugger. Visual Studio 2010 调试器中似乎确实存在错误/性能问题。

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

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