且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

更改 Appxmanifest 中的设置以用于不同的解决方案配置(UWP 项目)

更新时间:2022-05-08 06:20:34

我在项目中解决这个问题的方法是使用配置管理器(右键单击解决方案 -> 配置管理器)为解决方案创建额外的构建配置),然后制作 AppxManifest 的副本,操作各种构建配置所需的值,并提供与它们相关的文件名,即 Package.Test.xml.

The way I've got around this in projects is to create the additional build configurations for the solution using the Configuration Manager (right-click solution -> Configuration Manager) and then make a copy of the AppxManifest, manipulate the values you want for the various build configurations and give the files names that relate to them, i.e Package.Test.xml.

然后,您需要为应用项目设置构建事件(右键单击项目 -> 属性)以在预构建期间复制文件,如下所示:

You'll then want to setup your Build Events for the app project (right-click project -> Properties) to copy the file during a Pre-build like this: