Windows应用程序出错:长时间运行操作而不抽取Windows消息 [英] Error in windows application: long running operation without pumping Windows messages

查看:98
本文介绍了Windows应用程序出错:长时间运行操作而不抽取Windows消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在申请,我收到错误



< b>CLR无法从COM上下文转换到
0x2183e0到COM上下文0x218550 60秒。

拥有目标上下文/公寓的线程

最有可能是进行非抽运等待或处理

a非常长时间运行操作而不抽取Windows消息。

这种情况​​通常会对性能产生负面影响

甚至可能导致应用程序无响应

或内存使用量随着时间的推移不断累积。为了避免这个问题,所有单线程公寓(STA)线程

应该使用抽取等待原语(例如

CoWaitForMultipleHandles)并在长时间运行期间定期抽取消息





我的应用程序是基于VB.NET的窗口。



在我的应用程序我使用了一个连续运行的线程,在某些时候它给了我这个错误。



对于这个问题,我取消选中了视觉工作室DEBUG-> Exceptions-> Managed Debugging Assistant(MDA),在THROW列下我取消选中DisconnectedContext并且ContextSwitchDeadlock。但仍然无法检测到主要问题....



请建议是否有任何

Hi All,

I am having an application wherein I am getting an error

"The CLR has been unable to transition from COM context
0x2183e0 to COM context 0x218550 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."


My application is in VB.NET windows based.

In my application I have used a thread that run continuously and at some point of time it gives me this error.

For this issue I unchecked visual studios "DEBUG->Exceptions->Managed Debugging Assistant(MDA)" here under THROW column I have unchecked "DisconnectedContext" and "ContextSwitchDeadlock". But still not able to detect the main problem....

Please suggest if any

推荐答案

我以前见过这个,发现这是一个错误,只有当你的应用程序在调试器下的Debug构建下运行时才出现。在Visual Studio外部运行的发布版本根本不会显示此问题。
I've seen this before and found that it is an error that only shows up when your app is running under the the Debug build under the debugger. The Release build running outside Visual Studio will never show this problem at all.


这篇关于Windows应用程序出错:长时间运行操作而不抽取Windows消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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