WPF出现异常,其消息如下所示
System.Resources.MissingSatelliteAssemblyException
The satellite assembly named "Microsoft.VisualStudio.DesignTools.Designer.resources.dll, Version=16.0.0.0, PublicKeyToken=b03f5f7f11d5a3a" for fallback culture "en" either could not be found or could not be loaded. This is generally a setup problem. Please consider reinstalling or repairing the application.
如上所提示,VS环境下没有Microsoft.VisualStudio.DesignTools.Designer.resources.dll文件。一般情况下可以在安装目录下找到。其大致目录为:F:\Program Files (x86)\Microsoft Visual Studio 19\Common7\IDE\PrivateAssemblies下得某个语言包,比如我们示例中,缺少en(English)。
该错误的原因是我们使用了VS编辑器开发环境中不存在的语言环境。
解决方法:
1.我可以在我们程序对本地化文化(CultureInfo)使用存在的语言包,例如“zh-Hans”。
2.将en相关的信息报添加到我们的VS环境中。我没有尝试。
3.这个和我们软件安装时版本的问题,可以重新安装版本以及使用比较完整的版本(非Community)。