应用对象
.NET Framework 3.5 Service Pack 1

症状

请考虑以下情况:

  • 运行Microsoft .NET Framework 3.5 Service Pack 1 (SP1) 基于 Windows Presentation Foundation (WPF) 应用程序。

  • WPF 应用程序使用硬件呈现管道。

  • 应用程序加载和卸载包含一个或多个自定义 WPF 外接程序组件的多个应用程序域。

在此方案中,应用程序遇到 System.Runtime.InteropServices.COMException 异常,然后应用程序崩溃。

解决方法

修补程序信息

Microsoft提供了受支持的修补程序。 但是,此修补程序仅用于更正本文中所述的问题。 将此修补程序仅应用于遇到此特定问题的系统。 此修补程序可能会收到其他测试。 因此,如果你没有受到此问题的严重影响,我们建议你等待包含此修补程序的下一个软件更新。 若要从 MSDN 代码库下载此修补程序,请访问以下Microsoft网站:

http://code.msdn.microsoft.com/KB2276690注意 MSDN 代码库显示修补程序可用的语言。 如果未看到列出的语言,这是因为代码库资源页不适用于该语言。 注意 如果发生其他问题或需要进行任何故障排除,则可能必须创建单独的服务请求。 通常的支持成本将适用于不符合此特定修补程序条件的其他支持问题和问题。 有关Microsoft客户服务和支持电话号码的完整列表或创建单独的服务请求,请访问以下Microsoft网站:

http://support.microsoft.com/contactus/?ws=support

先决条件

若要应用此修补程序,必须安装 .NET Framework 3.5 Service Pack 1 (SP1) 。 

重启要求

应用此修补程序后,无需重新启动计算机。

修补程序替换信息

此修补程序不替换任何其他修补程序。

文件信息

此修补程序的英文版具有下表中列出的文件属性(或较新的文件属性)。 这些文件的日期和时间以协调世界时 (UTC) 格式列出。 在查看文件信息时,文件时间将转换为本地时间。 要了解 UTC 与本地时间之间的时差,请使用“控制面板”中“日期和时间”项中的“时区”选项卡。

对于所有受支持的基于 x86 的 Windows Server 2003 版本和 Windows XP

File name

文件版本

文件大小

日期

Time

Platform

Presentationcore.dll

3.0.6920.4033

4,218,880

2010 年 9 月 2 日

01:32

x86

Presentationframework.dll

3.0.6920.4033

5,279,744

2010 年 9 月 2 日

01:28

x86

Presentationhost.exe

4.0.40305.0

295,264

2010 年 9 月 2 日

01:28

x86

Presentationhostdll.dll

3.0.6920.4033

130,408

2010 年 9 月 2 日

01:32

x86

Presentationhostproxy.dll

4.0.31106.0

99,176

2010 年 9 月 2 日

01:32

x86

Windowsbase.dll

3.0.6920.4033

1,249,280

2010 年 9 月 2 日

01:32

x86

对于所有受支持的基于 x64 的 Windows Server 2003 版本和 Windows XP

File name

文件版本

文件大小

日期

Time

Platform

Presentationcore.dll

3.0.6920.4033

3,997,696

2010 年 9 月 2 日

00:53

x64

Presentationframework.dll

3.0.6920.4033

4,636,672

2010 年 9 月 2 日

00:48

x64

Presentationhost.exe

4.0.31106.0

320,352

2010 年 9 月 2 日

00:48

x64

Presentationhostdll.dll

3.0.6920.4033

171,368

2010 年 9 月 2 日

00:53

x64

Presentationhostproxy.dll

4.0.31106.0

109,928

2010 年 9 月 2 日

00:53

x64

Windowsbase.dll

3.0.6920.4033

1,110,016

2010 年 9 月 2 日

00:53

x64

对于所有受支持的基于 x86 版本的 Windows Vista Service Pack 2 (SP2) 和 Windows Server 2008 Service Pack 2 (SP2)

File name

文件版本

文件大小

日期

Time

Platform

Presentationcore.dll

3.0.6920.4033

4,218,880

2010 年 9 月 9 日

10:52

x86

Presentationfontcache.exe.config

不适用

161

2009 年 4 月 3 日

2,125

不适用

Wpfgfx_v0300.dll

3.0.6920.4003

1,736,024

2009 年 6 月 17 日

03:08

x86

Presentationframework.dll

3.0.6920.4033

5,279,744

2010 年 9 月 9 日

10:52

x86

Presentationhostdll.dll

3.0.6920.4033

130,408

2010 年 9 月 9 日

10:52

x86

Windowsbase.dll

3.0.6920.4033

1,249,280

2010 年 9 月 9 日

10:52

x86

对于所有受支持的基于 x64 的 Windows Vista SP2 和 Windows Server 2008 SP2 版本

File name

文件版本

文件大小

日期

Time

Platform

Presentationcore.dll

3.0.6920.4033

3,997,696

2010 年 9 月 9 日

10:52

x64

Presentationfontcache.exe.config

不适用

161

2009 年 4 月 3 日

20:58

不适用

Wpfgfx_v0300.dll

3.0.6920.4003

2,254,168

2009 年 6 月 17 日

03:08

x64

Presentationframework.dll

3.0.6920.4033

4,636,672

2010 年 9 月 9 日

10:52

x64

Presentationhostdll.dll

3.0.6920.4033

171,368

2010 年 9 月 9 日

10:52

x64

Windowsbase.dll

3.0.6920.4033

1,110,016

2010 年 9 月 9 日

10:52

x64

对于所有受支持的基于 x86 的 Windows 7 版本

File name

文件版本

文件大小

日期

Time

Platform

Presentationcore.dll

3.0.6920.5012

4,218,880

2010 年 9 月 11 日

01:29

x86

Presentationfontcache.exe.config

不适用

161

2009 年 6 月 10 日

21:14

不适用

Wpfgfx_v0300.dll

3.0.6920.4902

1,736,536

2009 年 6 月 10 日

21:14

x86

Presentationframework.dll

3.0.6920.5012

5,279,744

2010 年 9 月 11 日

01:29

x86

Presentationhostdll.dll

3.0.6920.5012

130,408

2010 年 9 月 11 日

01:29

x86

Presentationhost.exe

4.0.31106.0

295,264

2010 年 9 月 11 日

01:29

x86

Presentationhostproxy.dll

4.0.31106.0

99,176

2010 年 9 月 11 日

01:29

x86

Windowsbase.dll

3.0.6920.5012

1,253,376

2010 年 9 月 11 日

01:29

x86

对于所有受支持的基于 x64 的 Windows 7 版本和 Windows Server 2008 R2 版本

File name

文件版本

文件大小

日期

Time

Platform

Presentationcore.dll

3.0.6920.5012

3,997,696

2010 年 9 月 11 日

01:28

x64

Presentationfontcache.exe.config

暂缺

161

2009 年 6 月 10 日

20:30

暂缺

Wpfgfx_v0300.dll

3.0.6920.4902

2,255,176

2009 年 6 月 10 日

20:30

x64

Presentationframework.dll

3.0.6920.5012

4,636,672

2010 年 9 月 11 日

01:28

x64

Presentationhostdll.dll

3.0.6920.5012

171,368

2010 年 9 月 11 日

01:28

x64

Presentationhost.exe

4.0.31106.0

320,352

2010 年 9 月 11 日

01:28

x64

Presentationhostproxy.dll

4.0.31106.0

109,928

2010 年 9 月 11 日

01:28

x64

Windowsbase.dll

3.0.6920.5012

1,114,112

2010 年 9 月 11 日

01:28

x64

状态

Microsoft 已经确认这是一个列于“适用范围”部分的 Microsoft 产品问题。

解决方法

若要解决此问题,请禁用硬件呈现管道,然后启用软件呈现管道。 若要禁用硬件呈现管道并启用软件呈现管道,请使用以下方法之一:

  • 设置 System.Windows.Interop.RenderMode 枚举。下面是一些示例代码,用于设置 System.Windows.Interop.RenderMode 枚举,以便在加载 WPF 窗口时启用软件呈现管道:

    private void OnLoaded(object sender, EventArgs e){System.Windows.Interop.HwndSource hwndSource = PresentationSource.FromVisual(this) as System.Windows.Interop.HwndSource;System.Windows.Interop.HwndTarget hwndTarget = hwndSource.CompositionTarget; hwndTarget.RenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;}
  • 设置 DisableHWAcceleration 注册表项。重要说明 本部分、方法或任务包含有关如何修改注册表的步骤。 但是,注册表修改不当可能会出现严重问题。 因此,请一定严格按照下列步骤操作。 为了获得进一步的保护,请在修改注册表之前对其进行备份。 这样就可以在出现问题时还原注册表。 有关如何备份和还原注册表的更多信息,请单击下面的文章编号查看 Microsoft 知识库中相应的文章:

    322756 如何在 Windows中备份和还原注册表警告 此方法禁用计算机上的所有 WPF 应用程序的硬件呈现管道。 因此,通常不鼓励使用 方法,除非客户控制环境,并且不介意所有 WPF 应用程序的效果。

    1. 单击 “开始”,单击“ 运行”,键入“regedit”,然后按 Enter。

    2. 找到并单击下面的注册表子项:

      HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics

    3. DisableHWAcceleration 注册表项的值设置为 1。注意 如果 DisableHWAcceleration 注册表项不存在,请右键单击注册表子项,指向“新建”,然后单击“ 字符串值 ”以创建新的注册表项。 键入 DisableHWAcceleration 作为新注册表项的名称,双击 DisableHWAcceleration,然后将 DisableHWAcceleration 值数据更改为 1

    4. 退出注册表编辑器。

更多信息

有关软件呈现管道的详细信息,请访问以下Microsoft开发人员网络 (MSDN) 网站:有关软件呈现管道的一般信息 有关 WPF 呈现的注册表设置的详细信息,请访问以下 MSDN 网站:有关 WPF 呈现的注册表设置的常规信息有关 System.Windows.Interop.RenderMode 枚举的详细信息,请访问以下 MSDN 网站:有关“System.Windows.Interop.RenderMode”枚举的常规信息

需要更多帮助?

需要更多选项?

了解订阅权益、浏览培训课程、了解如何保护设备等。