c# - 应用程序错误 System.InvalidOperationException : An unspecified error occurred on the render thread

标签 c# .net wpf .net-4.0

我们的 Framework 3.5 sp1,WPF 应用程序随机挂起,在 XP 和 win 7 机器上出现以下异常。我们有数百名用户,这种情况对任何人都是随机发生的,我们没有看到异常发生的任何模式。我们搜索了很多,MS 发布了一个 3.5 补丁,它也包含在 3.5 sp1 中,应该可以解决这个问题,但正如您所见,它仍然发生在我们身上。

ERROR 2012-12-10 08:56:12,348[UI]: Host : Application ErrorSystem.InvalidOperationException: An unspecified error occurred on the render thread.
   at System.Windows.Media.MediaContext.NotifyPartitionIsZombie(Int32 failureCode)
   at System.Windows.Media.MediaContext.NotifyChannelMessage()
   at System.Windows.Interop.HwndTarget.HandleMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 

我们在日志中看到,在抛出上述 Renderthread 异常之前,以下异常被重复记录了 10-15 次。在异常开始出现之前,我们还注意到日志中有一段短暂的不活动时间(10-15 分钟)

ERROR 2012-12-04 10:38:30,854[UI]: Host : Application ErrorSystem.Runtime.InteropServices.COMException (0x88980406): Exception from HRESULT: 0x88980406
   at System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
   at System.Windows.Media.Composition.DUCE.CompositionTarget.UpdateWindowSettings(ResourceHandle hCompositionTarget, RECT windowRect, Color colorKey, Single constantAlpha, MILWindowLayerType windowLayerType, MILTransparencyFlags transparencyMode, Boolean isChild, Boolean isRTL, Boolean renderingEnabled, Int32 disableCookie, Channel channel)
   at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet)
   at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget)
   at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)
   at System.Windows.Interop.HwndTarget.HandleMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

重新启动应用程序可解决问题。然而,这正迅速成为我们优先考虑的问题。非常感谢任何有助于解决此问题的指示。

最佳答案

这是一种红鲱鱼。该问题已由工程团队解决。我们的用户使用虚拟机并使用 citrix 连接到机器。 citrix 为使用客户端计算机 cpu/gpu 卸载图形和渲染而启用的反向无缝设置导致了此问题。

关于c# - 应用程序错误 System.InvalidOperationException : An unspecified error occurred on the render thread,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13825598/

相关文章:

c# - 如果在 using block 中调用 return,那么幕后操作的顺序是什么?

.net - 使用 SSL 的 Restful 服务

c# - 向动态创建的对象添加过渡

c# - 使用Moq和Xunit测试接口(interface)

c# - facebook c# sdk 入门

.net - 确定 dll 的 .NET Framework 版本

c# - WPF 中的 DatePicker 显示 01.01.0001 而不是今天

C# WPF XAML 在 UserControl 加载上运行 XAML 命令

c# - 使用 Dapper SplitOn 时如何映射对象?

.net - BCL 和 FCL - 都是命名空间?