本文记录 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.30319Description: The process was terminated due to an unhandled exception.Exception Info: System.ComponentModel.Win32Exception
Exception Info: System.DllNotFoundExceptionat 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
2、KB4040973 是 net46以上 相关更新程序;发布时间:2017 年 9 月 12 日
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
官方措施
在 .NET Core 版本修复
Adding d3d_compiler dependency to known issues by rladuca · Pull Request #190 · dotnet/wpf
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。 欢迎转载、使用、重新发布,但务必保留文章署名 林德熙 (包含链接: https://blog.lindexi.com ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请与我 联系。