添加 .resx 文件时使用 WPF .net Core 3.0 编译错误 [英] Compile error with WPF .net Core 3.0 when adding .resx files

查看:26
本文介绍了添加 .resx 文件时使用 WPF .net Core 3.0 编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下按预期工作:VS Studio 2019 经过专业人士和社区的测试.

Following works as expected: VS Studio 2019 tested with professional and community.

  • 创建新的 APF 应用程序 (.NET Framework)
  • 打开属性文件夹
  • 将 Resources.resx 更改为公开
  • 创建一个新的资源文件 (Resources.de.resx)
  • 构建

按预期编译

以下不起作用:

  • 创建新的 APF 应用 (.NET Core)
  • 创建资源文件夹
  • 创建一个新的资源文件 (Resources.resx)
  • 将其更改为公开
  • 创建一个新的资源文件 (Resources.de.resx)
  • 构建

使用 VS 2019 专业版和社区在 3 台不同的机器上对其进行了测试

Tested it on 3 different machines with VS 2019 professional and community

编译错误:

错误自定义工具 PublicResXFileCodeGenerator 未能为输入文件ResourcesResources.de.resx"生成输出,但未记录特定错误.WpfApp4 C:...source eposWpfApp4WpfApp4ResourcesResources.de.resx 1

Error Custom tool PublicResXFileCodeGenerator failed to produce an output for input file 'ResourcesResources.de.resx' but did not log a specific error. WpfApp4 C:...source eposWpfApp4WpfApp4ResourcesResources.de.resx 1

错误 MSB3086 任务无法使用 SdkToolsPath"或注册表项HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SDKsNETFXSDK4.7.2WinSDK-NetFx40Tools-x86"找到al.exe".确保设置了 SdkToolsPath 并且该工具存在于 SdkToolsPath 下正确的处理器特定位置,并且安装了 Microsoft Windows SDK WpfApp4 C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildCurrentBinMicrosoft.Common.CurrentVersion.targets 3639

Error MSB3086 Task could not find "al.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SDKsNETFXSDK4.7.2WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed WpfApp4 C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildCurrentBinMicrosoft.Common.CurrentVersion.targets 3639

还在微软创建了一张票

https://developercommunity.visualstudio.com/content/problem/771961/compile-error-with-wpf-net-core-30-when-adding-res.html

推荐答案

尝试安装 .NET Framework 4.7.2 开发包.仅用于编译.

Try to install .NET Framework 4.7.2 Developer Pack. It is needed only for compilation.

这篇关于添加 .resx 文件时使用 WPF .net Core 3.0 编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆