c# – 诊断ObjectDisposedException“安全句柄已关闭”

前端之家收集整理的这篇文章主要介绍了c# – 诊断ObjectDisposedException“安全句柄已关闭”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个C#应用程序,该消息正在触发ObjectDisposedException

Safe handle has been closed

一旦我启动应用程序,就会发生这种情况.

遗憾的是,堆栈跟踪真的没有帮助(见下文).有什么办法可以确定在这里异步尝试什么呼叫?

DoAsyncCall()是否真的意味着异步方法调用

mscorlib.dll!System.Threading.EventWaitHandle.Set() + 0xe bytes
mscorlib.dll!System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage
msg) + 0x12f bytes
mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage
msg,System.Runtime.Remoting.Messaging.IMessageSink replySink =
{System.Runtime.Remoting.Messaging.AsyncResult}) + 0x279 bytes
mscorlib.dll!System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.DoAsyncCall()
+ 0x32 bytes mscorlib.dll!System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(object
o) + 0x28 bytes
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(object
state) + 0x2f bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
executionContext,System.Threading.ContextCallback callback,object
state) + 0x6f bytes
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback
tpWaitCallBack) + 0x53 bytes
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(object
state) + 0x59 bytes

解决方法

你正在处理一些仍然被不同线程使用的东西.
原文链接:https://www.f2er.com/csharp/96241.html

猜你在找的C#相关文章