msbuild:构建为 appxbundle(AppxBundle=始终不工作)

msbuild: build as to a appxbundle (AppxBundle=Always not working)

我有一个共享的 Windows8.1 项目,其中有一个 Phone 和桌面项目。我定义了不同的配置来为桌面构建 x86/x64,为 phone.

构建 ARM

msbuild 工作正常,没有错误,但在输出文件夹(或其他任何地方)上没有最终的 *.appxbundle 文件,尽管我设置了参数 AppxBundle=Always.

我的命令是这样的:

msbuild myApp.sln /p:OutputPath=%OUTPATH%;Configuration=Phone;Platform=ARM;AppxBundle=Always;AppxBundlePlatforms=ARM /t:Rebuild,Publish

输出为:

OUTPATH
├── ForBundle
│   └── AppxManifest.xml
├── AppxManifest.xml
├── App.WindowsPhone.build.appxrecipe
├── App.WindowsPhone_3.2.1_ARM.appx
├── App.WindowsPhone_3.2.1_scale-100.appx
├── App.WindowsPhone_3.2.1_scale-140.appx
├── App.WindowsPhone_3.2.1_scale-180.appx
├── resources.pri
└── SomeDependency.winmd

我尝试用 makeappx.exe 包打包此文件夹,但这没有用,我意识到该文件夹​​看起来与 appxbundle 中的内容有点不同。

通过 VS GUI 创建一个 appxbundle 没有问题,但我想自动化这一步!

提前致谢!

Microsoft.AppXPackage.Targets中有提示评论:

When building on the command line or in TFS (determined by looking at the $(BuildingInsideVisualStudio) property), if build is invoked on an app package-producing project, the package for the project will be produced as part of building the project without specifying any additional flags or targets. This is control by an MSBuild property named GenerateAppxPackageOnBuild which is set to true by default.

If $(BuildingInsideVisualStudio) = false and $(GenerateAppxPackageOnBuild) = true, then build will also produce a package. true