本文记录 D3Dcompiler_47 丢失问题,在安装 KB4040973 KB3178034 完成的 win7 系统可能出现 D3Dcompiler_47 丢失,让 WPF 等软件无法启动

现象

现象是无法启动,可以在事件查看器看到日志

错误应用程序名称: xx.exe,版本: 5.1.3.33526,时间戳: 0x59c5951c
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.17514,时间戳: 0x4ce7bafa
异常代码: 0xe0434352
错误偏移量: 0x0000b727
错误进程 ID: 0x8c
错误应用程序启动时间: 0x01d339ce8c34bedb
错误应用程序路径: xx
错误模块路径: C:\Windows\syswow64\KERNELBASE.dll
报告 ID: cca5651f-a5c1-11e7-9921-00155d356504

调用堆栈

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ComponentModel.Win32Exception

Exception Info: System.DllNotFoundException
at MS.Internal.NativeWPFDLLLoader.LoadNativeWPFDLL(UInt16*, UInt16*)
at MS.Internal.NativeWPFDLLLoader.LoadCommonDLLsAndDwrite()
at <Module>.CModuleInitialize.{ctor}(CModuleInitialize*, Void ())
at <Module>.?A0x721f77f1.CreateCModuleInitialize()

解决方法

安装在 Windows Server 2012、Windows Server 7 和 Windows Server 2008 R2 上的 d3dcompiler_47.dll 组件的更新

注意,此时卸载重装 .NET 4.5 可以解除依赖,但是如果用到像素着色器依然会提示文件损坏

复现步骤

step1:安装 .NET 4.6 (4.6、4.6.1、4.6.2都会出现这个问题)

step2:安装以下两个更新:KB4040973 KB3178034 (任意安装顺序);

说明:

1、KB3178034 是 Microsoft 图形组件安全更新程序;发布时间:2016 年 8 月 9 日

MS16-097: Description of the security update for Microsoft Graphics Component: August 9, 2016

Microsoft 安全公告 MS16-097 - 严重

2、KB4040973 是 net46以上 相关更新程序;发布时间:2017 年 9 月 12 日

Description of the Security and Quality Rollup for the .NET Framework 4.6, 4.6.1, 4.6.2, and 4.7 for Windows 7 SP1 and Windows Server 2008 R2 SP1 and for the .NET Framework 4.6 for Windows Server 2008 SP2: September 12, 2017

3、上述更新安装后,计算机上并不会出现 D3Dcompiler_47.dll ,但引入了其依赖;

4、上述更新必须同时安装,只安装其中一个不会出现问题。

5、出现这个问题之后,重新安装.NET4.6,或者升级 .NET4.6 为 4.6.1或4.6.2不能解决问题。

影响范围

  • 用 .NET 4.5 和以上版本的 WPF 程序
  • 其他用到像素着色器的 win32 程序

相关链接

win7系统电脑丢失D3DCOMPILER_47.DLL 怎么办 - Microsoft Community

启动时出现 Photoshop 系统错误 - 缺少 D3DCOMPILER_47.dll

WPF程序停止工作-CSDN论坛

官方措施

在 .NET Core 版本修复

Adding d3d_compiler dependency to known issues by rladuca · Pull Request #190 · dotnet/wpf

WPF Applications require crash with System.TypeLoadException when VC++ redistributables are not present · Issue #37 · dotnet/wpf


本文会经常更新,请阅读原文: https://blog.lindexi.com/post/win7-%E6%97%A0%E6%B3%95%E5%90%AF%E5%8A%A8-WPF-%E7%A8%8B%E5%BA%8F-D3Dcompiler_47.dll-%E4%B8%A2%E5%A4%B1.html ,以避免陈旧错误知识的误导,同时有更好的阅读体验。

如果你想持续阅读我的最新博客,请点击 RSS 订阅,推荐使用RSS Stalker订阅博客,或者收藏我的博客导航

知识共享许可协议 本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。欢迎转载、使用、重新发布,但务必保留文章署名林德熙(包含链接: https://blog.lindexi.com ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请 与我联系

微软最具价值专家


无盈利,不卖课,做纯粹的技术博客

以下是广告时间

推荐关注 Edi.Wang 的公众号

欢迎进入 Eleven 老师组建的 .NET 社区

以上广告全是友情推广,无盈利