UWP与Desktop Bridge软件包的MSbuild自动化构建 [英] UWP with Desktop Bridge package build automation with MSbuild

查看:106
本文介绍了UWP与Desktop Bridge软件包的MSbuild自动化构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何使用MSbuild工具通过Desktop Bridge(桌面扩展)软件包生成(.appxupload/.appxbundle)自动执行UWP吗?

我已经在后续博客.

Does anyone know how to automate UWP with Desktop Bridge (Desktop Extension) package build (.appxupload/.appxbundle) by using MSbuild tool?

I've got the setup like on the following blog.

对于简单的UWP应用(不带Desktop Extension),我可以使用以下命令进行操作:

For the simple UWP app (without Desktop Extension) I’m able to this with the following command:

msbuild UWP.sln /p:Configuration=Release;AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM";UapAppxPackageBuildMode=StoreUpload

但是,当我在Package.wapproj上尝试时,出现了很多错误. 例如,尽管Package项目具有证书,但UWP项目也需要一个证书(为什么?),当我解决该问题时,msbuild要求从bin/Debug获得build.appxrecipe,尽管我正在构建Release等.

However, when I try it on Package.wapproj I’ve got a bunch of errors. For instance, although Package project has a certificate, UWP project also demands one (why?), when I workaround that problem, msbuild demands a build.appxrecipe from bin/Debug, although I’m building Release etc.

推荐答案

此处的经验相同,但是我设法通过分别构建x86和x64项目来绕过找不到配方文件"错误,然后运行msbuild命令打包两者.这是我的笔记:

Same experience here, but I manage to bypass the "Could not find a recipe file" error by build x86 and x64 project separately, and then run the msbuild command to package both. Here are my notes:

  1. 因为我的解决方案有一个Desktop Extension项目,几个c#项目和几个测试项目,所以我必须在项目文件中一一指定<AppxBundle>Always</AppxBundle><AppxBundle>Never</AppxBundle>.

同时清洁x86和x64.

Clean both x86 and x64.

首先构建x86. msbuild .\MyApp.sln /p:Configuration=Release /p:Platform=x86

构建x64. msbuild .\MyApp.sln /p:Configuration=Release /p:Platform=x64

在命令行中运行以下msbuild命令:

Run this msbuild command in command line:

msbuild .\MyApp.sln /p:Configuration=Debug /p:AppxBundlePlatforms="x86|x64" /p:AppxPackageDir="C:\Develop\MyApp\AppPackages\" /p:UapAppxPackageBuildMode=StoreUpload

请注意,我必须在命令中添加 AppxPackageDir ,否则它将仅捆绑x64,而不捆绑x86.我不知道为什么.

Note that I have to add AppxPackageDir in the command, otherwise it will only bundle x64, not x86. I don't know why yet.

然后,您将看到所有捆绑文件夹都在 AppxPackageDir 下创建,包括x64和x86.一个单独的上传捆绑包将在文件夹之外创建.

Then you will see all the bundle folders are created under the AppxPackageDir, both x64 and x86. The one single upload bundle will be created outside of the folders.

构建发布版本需要花费很多时间,但可以在命令行中使用.自动化,我们开始吧!

It takes forever to build the release builds, but it works in command line. Automation, here we go!

这篇关于UWP与Desktop Bridge软件包的MSbuild自动化构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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