检测到ContextSwitchDeadlock [英] ContextSwitchDeadlock was detected

查看:265
本文介绍了检测到ContextSwitchDeadlock的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误"检测到ContextSwitchDeadlock"在尝试对超网格行执行单击操作时抛出。

An error "ContextSwitchDeadlock was detected" is thrown while trying to perform the click operations on ultragrid rows.

错误的详细信息如下:

检测到ContextSwitchDeadlock

消息:CLR无法从COM上下文0x44d3a8过渡到COM上下文0x44d5d0 60秒。拥有目标上下文/公寓的线程很可能是在非抽空等待或处理非常长时间运行的操作
而不抽取Windows消息。这种情况通常会对性能产生负面影响,甚至可能导致应用程序变得无响应或内存使用量随时间不断累积。为了避免这个问题,所有单线程单元
(STA)线程都应该使用抽取等待原语(例如CoWaitForMultipleHandles)并在长时间运行期间定期泵送消息。

ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x44d3a8 to COM context 0x44d5d0 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.

任何人都可以帮助我如何解决这些问题?

Can anyone help me how to resolve the issues?

 

问候,

Basava Kumar M

Basava Kumar M

推荐答案

如果在调试模式下运行Coded UI Test,可能会发生这种情况。但如果禁用它,它不会影响测试的执行。以下是克服此问题的方法:

This may occur if you are running a Coded UI Test in debugging mode. But it will not affect the execution of your test if you disable it. Following is a way to overcome this:

在VS中禁用ContextSwitchDeadlock异常,如下所示:

Disable ContextSwitchDeadlock exception in VS as follows:

转到Debug-> Exceptions->'Managed调试助手'。取消选中ContextSwitchDeadlock的复选框。

Go to Debug->Exceptions->'Managed Debugging Assistents'. Uncheck the check-box against ContextSwitchDeadlock.


这篇关于检测到ContextSwitchDeadlock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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