2

I am using Visual Studio online build with an MSBuild task. I currently have the following MSBuild Arguments fed to my task:

/p:Configuration=Release;AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM";AppxPackageDir="$(Build.BinariesDirectory)\AppxPackages\\";UapAppxPackageBuildMode=StoreUpload

This creates my application in x86, x64 and ARM. It creates Release version of the libraries in x86 BUT creates Debug version of my libraries in x64 and ARM.

When my .appxupload package is creates it fails Windows Certification tests because my libraries are built in debug.

How can I make MSBuild build for all 3 configurations. My guess is because I haven't provided a /platform configuration. How do I provide this configuration for 3 platforms?

I have tried platform="x86|x64|ARM" but it returned an error

Zhendong Wu - MSFT
  • 1,769
  • 1
  • 8
  • 10
JKennedy
  • 18,150
  • 17
  • 114
  • 198
  • It would be helpful if you could also list which version of MSBuild you are using and which version of the UWP SDK you are targeting. – Chris Patterson Jun 08 '17 at 12:52
  • Using Vs2017 MsBuild, targeting Windows 10 Anniversary Edition – JKennedy Jun 08 '17 at 13:27
  • Can you share the build log and the error you see from the WACK? (you can send me the details to rmpablos at ms dot com) – rido Jun 08 '17 at 16:50
  • @rido it seems to be building in release now correctly. I think it was because I had ticked the `clean` for the task. Seemed to be producing `x86` in release and the other two in debug. very strange – JKennedy Jun 09 '17 at 08:57

1 Answers1

4

For a standard project file there's no way to do this in a single command. Either use multiple commands to build the project for each platform/configuration combination needed, or use a 'master' build file which does the same for you, something like:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="FullRebuild">
  <Target>
    <ItemGroup>
      <Configurations Include="Debug;Release"/>
      <Platforms Include="x86;x64;ARM"/>
      <ConfigAndPlatform Include="@(Configurations)">
        <Platform>%(Platforms.Identity)</Platform>
      </ConfigAndPlatform>
    </ItemGroup>
    <MSBuild Projects="myproject.sln" Targets="Build"
             Properties="Configuration=%(ConfigAndPlatform.Identity);Platform=%(ConfigAndPlatform.Platform)"/>
  </Target>
</Project>
stijn
  • 34,664
  • 13
  • 111
  • 163
  • So to do this for Automated build I would probably need 3 MSbuild tasks with seperate configurations and then 1 task that would create my StoreUpload? Is that essentially what Visual Studio must do when you "Create a package for store"? – JKennedy Jun 08 '17 at 13:02
  • 1
    1) yes, or as shown in the answer, one task which calls the MsBuild 3 times for you 2) Sorry, I don't know as I have no experience with that – stijn Jun 08 '17 at 14:07
  • UWP targets built the three platforms from a single MSBuild command – rido Jun 08 '17 at 16:45
  • @rido yeah I'm not familiar with it; is the syntax really just /p:platform="a|b|c"? – stijn Jun 08 '17 at 19:00