近期遇到一个问题。窗口在Loaded同一时候Resize会出现黑屏或者直接崩溃, 调查发现是WPF后端的Render线程渲染UI到DirectX时崩溃。

硬件环境:WES7 + .Net4.0
WPF 应用程序从两个线程開始:一个用于处理呈现,一个用于管理 UI。呈现线程有效地隐藏在后台执行,而 UI 线程则接收输入、处理事件、绘制屏幕以及执行应用程序代码。

遇到的这个问题就是用于处理呈现的线程挂了,异常例如以下:
Exception from HRESULT: 0x88980406
Stack Trace:
0000000021a4d8d8 000007fef7a66869 [HelperMethodFrame: 0000000021a4d8d8]
0000000021a4da20 000007fee485ae0f System.Windows.Media.Composition.DUCE+Channel.SyncFlush()*** WARNING: Unable to verify checksum for PresentationCore.ni.dll
0000000021a4dae0 000007fee3e95615 System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean, System.Nullable`1<ChannelSet>)
0000000021a4dd10 000007fee3eabfec System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean)
0000000021a4dd80 000007fee3eabd0e System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr)
0000000021a4dee0 000007fee3e95fd7 System.Windows.Interop.HwndTarget.HandleMessage(MS.Internal.Interop.WindowMessage, IntPtr, IntPtr)
0000000021a4e070 000007fee3e93d14 System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
0000000021a4e0c0 000007fee4b2b450 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
1. Update your video drivers, and/or try different video hardware in the problem machine(s). 【试过560、660、770、970显卡都不会解决这个问题。 试过320.18, 320.49, 353.30等驱动也都不会解决这个问题】
2. Disable Hardware rendering. As a quick test, you can use the DisableHWAcceleration registry value discussed here. You would set the value to 1 in order to disable WPF's hardware rendering pipeline. Note that this affects all WPF applications running in that user's session, so be advised you might be impacting more than one application. There are other options for disabling hardware acceleration at a more granular level. Starting in .Net 3.5, you can disable it programmatically on a per-window basis by using the HwndTarget.RenderMode property. Starting in .Net 4.0, you can disable it programmatically on a per-process basis by using the RenderOptions.ProcessRenderMode property. 【更改注冊表不会解决这个问题】
3. Upgrade to the latest version and service pack level of the .Net Framework available for your target platform. 【升级到Net 4.5后。问题解决。降级到4.0后。又出现】
4. Disable the use of Windows.AllowsTransparency and Popup.AllowsTransparency in your application.【包装的应用窗口的AllowsTransparency为False】
5. If you are on Windows XP or Windows 2003, test on a newer operating system, and upgrade if possible.【没有測试。升级OS不太可能】
6. If System.OutOfMemoryExceptions are being reported, then monitor the process's memory usage in Performance Monitor; particularly the Process\Virtual Bytes, Process\Private Bytes, and .NET CLR Memory\# Bytes in All Heaps counters. Also monitor the User Objects and GDI Objects for the process in Windows Task Manager. If you can determine that a specific resource is being exhausted, then troubleshoot the application to fix whatever is causing that resource consumption. Ultimately that should resolve the System.OutOfMemoryException.【查看内存和句柄等,没有内存泄露】

WPF 后台Render线程崩溃, Exception from HRESULT: 0x88980406的更多相关文章

  1. Unable to create the store directory. (Exception from HRESULT: 0x80131468)

    一个ASP.NET的程序,使用了MS ReportViewer报告控件,在用该控件导出生成Excel文件时,先是提示行不能超过65535. 这个是由于Excel2003的行限制的原因.由于修改成用Ex ...

  2. 格式太旧或是类型库无效。 (Exception from HRESULT: 0x80028019 (TYPE_E_UNSUPFORMAT))

    错误提示信息 格式太旧或是类型库无效. (Exception from HRESULT: 0x80028019 (TYPE_E_UNSUPFORMAT)) . Old format or invali ...

  3. 在 WPF 中的线程

    线程处理使程序能够执行并发处理,以便它可以做多个操作一次.节省开发人员从线程处理困难的方式,设计了 WPF (窗口演示文稿基金会).这篇文章可以帮助理解线程在 WPF 中的正确用法. WPF 内部线程 ...

  4. WPF后台动画DoubleAnimation讲解

    WPF后台动画,使用DoubleAnimation做的. 1.移动动画 需要参数(目标点离最上边的位置,目标点离最左边的位置,元素名称) Image mImage = new Image(); Flo ...

  5. 线程崩溃为什么不会导致 JVM 崩溃

    大家好,我是坤哥 网上看到一个很有意思的据说是美团的面试题:为什么线程崩溃崩溃不会导致 JVM 崩溃,这个问题我看了不少回答,但都没答到根本原因,所以决定答一答,相信大家看完肯定会有收获,本文分以下几 ...

  6. 错误信息:内存位置访问无效。 (Exception from HRESULT: 0x800703E6)

    错误提示: 错误信息:内存位置访问无效. (Exception from HRESULT: 0x800703E6) 异常类型:System.BadImageFormatException 堆栈跟踪: ...

  7. IIS报错:Exception from HRESULT: 0x8007000B解决方法

    报错如下: System.Web.Services.dll 中发生,但未在用户代码中进行处理 其他信息: 服务器无法处理请求. ---> 尝试加载 Oracle 客户端库时引发 BadImage ...

  8. 利用office2000组件进行填充打印报不支持集合。 (Exception from HRESULT: 0x80020011 (DISP_E_NOTACOLLECTION))

    环境:win2008 64位+.net4.0 +office2000 错误提示: 不支持集合. (Exception from HRESULT: 0x80020011 (DISP_E_NOTACOLL ...

  9. System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800AC472

    更新至服务器后运行出错: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800AC472 解决方法 注册 ...

随机推荐

  1. iOS-OAuth认证

    OAuth授权 OAuth授权分四步: 第一步,应用向服务提供方申请请求令牌(Request Token),服务提供方验证通过后将令牌返回.这个步骤由于涉及到应用帐号密码,在应用的服务端发起,所以这个 ...

  2. Flask获取post提交数据

    完成示例 # flask 代码 from flask import Flask,request ... @app.route('/get_tasks',methods=["POST" ...

  3. 标准C程序设计七---47

    Linux应用             编程深入            语言编程 标准C程序设计七---经典C11程序设计    以下内容为阅读:    <标准C程序设计>(第7版) 作者 ...

  4. Codeforces 868F Yet Another Minimization Problem(分治+莫队优化DP)

    题目链接  Yet Another Minimization Problem 题意  给定一个序列,现在要把这个序列分成k个连续的连续子序列.求每个连续子序列价值和的最小值. 设$f[i][j]$为前 ...

  5. UVALive 5135 Mining Your Own Business 双连通分量

    据说这是一道Word Final的题,Orz... 原题链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&a ...

  6. luogu P3808 【模板】AC自动机(简单版)

    题目背景 这是一道简单的AC自动机模板题. 用于检测正确性以及算法常数. 为了防止卡OJ,在保证正确的基础上只有两组数据,请不要恶意提交. 管理员提示:本题数据内有重复的单词,且重复单词应该计算多次, ...

  7. 某考试 T3 bitboard

                    bitboardDiscription    天才发明家小K 制造了一块比特板.板子上有2^n个比特元,编号为0 ∼ 2^n−1.每个比特元

  8. DNA的复制

    半保留复制 DNA分子复制时, DNA分子的双螺旋将解开, 互补的碱基之间的氢键断裂, 解开的两条单链作为复制的模板, 游离的脱氧核苷酸依据碱基互补配对的原则, 通过形成氢键结合到作为模板的单链上. ...

  9. 类加载器在加载类 的时候就已经对类的static代码块和static变量进行了初始化

    类装载器ClassLoader 类装载器工作机制 类装载器就是寻找类的节码文件并构造出类在JVM内部表示对象的组件.在Java中,类装载器把一个类装入JVM中,要经过以下步骤: [1.]装载:查找和导 ...

  10. Handler处理机制

    handler缺点:如果要运送两种类型的数据(比如一个Bitmap,一个Object)就不能运送,但可以用Bunder来传输  *    使用handler的步骤:  *    1.创建一个handl ...