在过去的几年里,我一直在使用WPF在混合模式的应用程序中显示UI的各个位&。 C#程序集使用WPF生成UI - 它引用包含一些本机代码的C++/CLI构建的程序集。本地代码不会在几个printf之外进行OS调用;它纯粹是计算的。RaceOnRCWCleanup当关闭WPF应用程序
当使用附加的调试器运行时,我看到托管调试助手“RaceOnRCWCleanup”在关闭应用程序后触发 - 提示有一些COM组件具有多线程清理问题。
我没有直接以任何方式使用COM,但可能是C++/CLI或WPF。关于应用程序关闭的警告并不是特别可怕 - 毕竟,应用程序正在退出 - 但我很想知道发生了什么问题。我能做任何事情来避免此警告吗?有没有一个隐藏的问题在等待咬我,或者它是一个虚假的警告?
这是一个例子堆栈跟踪:
mscorlib.dll!System.Runtime.InteropServices.Marshal.ReleaseComObject(object o) Line 1826 + 0xc bytes C#
PresentationFramework.dll!System.Windows.Documents.TextServicesHost.DeactivateThreadManager() Line 465 + 0xd bytes C#
PresentationFramework.dll!System.Windows.Documents.TextServicesHost.OnUnregisterTextStore(object arg) Line 331 C#
PresentationFramework.dll!System.Windows.Documents.TextEditor.DetachTextStore(bool finalizer) Line 249 + 0x6b bytes C#
WindowsBase.dll!System.Windows.Threading.Dispatcher.ShutdownImplInSecurityContext(object state) Line 1363 + 0xfffffffc bytes C#
mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) Line 484 + 0xce bytes C#
任何人都经历了同样的问题?有人知道发生了什么事吗?
我们刚刚开始遇到这个问题后,我们的项目从.NET 3.5升级到4.0。 – 2011-02-17 17:46:17