c# - 添加 .resx 文件时 WPF .net Core 3.0 编译错误

标签 c# wpf .net-core localization resx

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

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

按预期编译

以下不起作用:

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

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

编译错误:

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

Error MSB3086 Task could not find "al.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.7.2\WinSDK-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 Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 3639

编辑:还在 Microsoft 创建了一个票证

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

最佳答案

尝试安装.NET Framework 4.7.2 Developer Pack 。仅在编译时需要它。

关于c# - 添加 .resx 文件时 WPF .net Core 3.0 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58298390/

相关文章:

azure - 克服 CosmosDB 20GB 逻辑分区大小

c# - Path.TryJoin 相对于 .NET Core 中的 Path.Combine 有什么优势?

c# - Entity Framework : Why do navigation properties disappear after a group by?

c# - 将 ReactiveList<enum> 绑定(bind)到组合框

c# - 自 iOS 13 以来,推送通知不再适用于 Xamarin 应用程序

wpf - 对作为 FrameworkElement 的值使用数据绑定(bind)

wpf - 如果在WPF中将控件的ItemSource属性设置为null,内存是否会泄漏?

asp.net - Dotnet核心2 docker : No executable found matching command "dotnet-watch"

c# - 将线程应用程序转换为服务

c# - 无法设置/获取 cookie 的值