【问题标题】:dotnet build UWP.sln | error MSB4019 Microsoft.Windows.UI.Xaml.CSharp.targets not founddotnet 构建 UWP.sln |错误 MSB4019 Microsoft.Windows.UI.Xaml.CSharp.targets 未找到
【发布时间】:2020-10-15 22:02:05
【问题描述】:

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

D:\MyFooProject.csproj(184,3): 错误 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 和 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项目。

【问题讨论】:

  • dotnet 目前不支持 uwp 吗?是的。有点明显。调用 MSBuild 来编译此类项目。

标签: .net .net-core uwp


【解决方案1】:

UWP 目前与 .NET Core 及其命令行界面 (CLI) 不兼容,因此使用 dotnet 构建 UWP 恐怕不会很好地工作。

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

【讨论】:

    猜你喜欢
    • 2014-09-13
    • 1970-01-01
    • 1970-01-01
    • 2013-11-12
    • 2017-09-07
    • 2015-02-07
    • 1970-01-01
    • 2021-11-15
    • 2018-11-29
    相关资源
    最近更新 更多