.net - dotnet 构建 UWP.sln |错误 MSB4019 Microsoft.Windows.UI.Xaml.CSharp.targets 未找到

标签 .net .net-core uwp

我有一个uwp我的解决方案中的项目。当我尝试通过 dotnet build 构建它时,实际上收到以下错误:

D:\MyFooProject.csproj(184,3): error MSB4019: Das importierte Projekt "C:\Program Files\dotnet\sdk\5.0.100-preview.5.20279.10\Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.targets" wurde nicht gefunden. Stellen Sie sicher, dass der Ausdruck in der Import-Deklaration "C:\Program Files\dotnet\sdk\5.0.100-preview.5.20279.10\Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.targets" richtig ist und dass die Datei auf dem Datenträger vorhanden ist.

csproj条目:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />

正如已经讨论过的( Microsoft.Windows.UI.Xaml.CSharp.targets missing on CI server ),如果我复制 C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.Targets 就可以构建。在我的 ci 服务器上。

我的计划或做法有问题吗dotnet目前不支持uwp ?因为无法通过dotnet new创建uwp项目.

最佳答案

UWP 目前与 .NET Core 及其命令行界面 (CLI) 不兼容,因此使用 dotnet 构建 UWP 恐怕效果不佳。

您应该从命令行使用 Visual Studio 或 MSBuild 来构建您的应用。

关于.net - dotnet 构建 UWP.sln |错误 MSB4019 Microsoft.Windows.UI.Xaml.CSharp.targets 未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62575474/

相关文章:

c# - 计算文本文件中的单词数

c# - 帮助理解 .NET 中的 Reader/Writer 模式

asp.net-core - Visual Studio 2019 - IIS Express - 连接已重置 (ERR_CONNECTION_RESET)

c# - UWP AcrylicBrush 向后兼容最低版本 14393(周年更新)

.net - 如何在 Windows Phone 8.1 中测试 "App Update"?

.net - 需要通过webservice在ASP.Net中生成图片

.net - 如何在 Visual Studio 2017 中从 .Net Core 控制台应用程序项目创建 EXE 输出?

c# - 在 .net 核心中设置全局时区

uwp - 更改列标题背景 DataGrid UWP

c# - FfmpegInterop UWP C#