使用Visual Studio 2022在GitHub Action中建立UWP项目

发布于 2025-01-17 18:43:57 字数 1225 浏览 3 评论 0原文

我正在尝试构建一个 UWP 项目作为 Github Actions 工作流的一部分。

在我的 YAML 中,我正在构建并运行一个单独的项目,以便我可以在本地调试我的 CICD 管道。这个单独的项目使用 msbuild 来构建我的主 UWP 项目。在最近的更改之前(Github 升级到 Windows Server 2022 作为默认运行程序 + 我的团队开始使用需要 VS2022 的语言功能),这工作得很好。现在我正在努力建造东西。

我已在 YAML 中指定使用 Windows Server 2019 和 Visual Studio 2022。

我运行的 msbuild 命令包括:

var command = @"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe";
var x86Arguments = $@"ApplicationName /restore /p:Configuration=Release /p:Verbosity=minimal /p:Platform=x86 /p:AppxBundle=Never /p:UapAppxPackageBuildMode=StoreUpload";

​​ 我遇到的错误是:

错误MSB4019:导入的项目 “C:\ Users \ runneradmin \ AppData \ Local \ Microsoft \ dotnet \ sdk \ 6.0.201 \ Microsoft \ WindowsXaml \ v17.0 \ Microsoft.Windows.UI.Xaml.CSharp.targets” 没有找到。确认进口申报中的表达式 “C:\ Users \ runneradmin \ AppData \ Local \ Microsoft \ dotnet \ sdk \ 6.0.201 \ Microsoft \ WindowsXaml \ v17.0 \ Microsoft.Windows.UI.Xaml.CSharp.targets” 是正确的,并且该文件存在于磁盘上。

我尝试在 github 运行程序中找到目标文件,它的唯一副本来自 VS2019 安装。

我已经尝试了各种针对此文件的尝试,但都不起作用。

有没有人成功地在 Github 工作流程中使用 msbuild 和 VS2022 构建 UWP 应用程序?

I'm trying to build a UWP project as part of a Github Actions Workflow.

In my YAML I am building and running a separate project so that I can debug my CICD pipeline locally. This separate project uses msbuild to build my main UWP project. Prior to recent changes (Github upgrading to Windows Server 2022 as the default runner + my team starting to use language features which require VS2022) this worked fine. Now I'm struggling to get things to build.

I've specified in my YAML to use Windows Server 2019 and Visual Studio 2022.

The msbuild command I run consists of:

var command = @"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe";
var x86Arguments = $@"ApplicationName /restore /p:Configuration=Release /p:Verbosity=minimal /p:Platform=x86 /p:AppxBundle=Never /p:UapAppxPackageBuildMode=StoreUpload";

The error I'm hitting is:

error MSB4019: The imported project
"C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\6.0.201\Microsoft\WindowsXaml\v17.0\Microsoft.Windows.UI.Xaml.CSharp.targets"
was not found. Confirm that the expression in the Import declaration
"C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\6.0.201\Microsoft\WindowsXaml\v17.0\Microsoft.Windows.UI.Xaml.CSharp.targets"
is correct, and that the file exists on disk.

I've tried to locate the targets file in the github runner and the only copy of it is from the VS2019 installation.

I've tried various attempts at targeting this file, which don't work.

Has anyone managed to build UWP apps with msbuild with VS2022 in a Github Workflow?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文