3

Any ideas as to why MSBuild is always building all my platforms for my UWP solution even though I'm specifying to only build for the ARM platform. This is the command line I'm using:

MSBuild.exe C:\MyApp\MyApp.sln /p:Configuration=Release /p:Platform=ARM

Am I missing something or doing something wrong?

Thanks.

UPDATE - 1:

I've also tried specifying x86 as the platform, but it still builds all platforms.

Thierry
  • 6,142
  • 13
  • 66
  • 117
  • if you're going to down the question, leave an explanation as to why!! I don't quite see what else I can provide but if there is something you feel should be provided, let me know and I'll provide it. – Thierry Apr 23 '16 at 22:50

1 Answers1

2

After spending hours trying to figure out this problem, I have eventually figured out what's wrong, well partially at least!

As mentioned, the above does not work as expected, unless I first create a package via the .NET IDE and only select a single platform. Once I do this, the above command line will build the relevant platform that's specified in the command line!

I've just tried it again and created a package via the .NET IDE and re-selected all platforms and called my original command line once again, and it build all platforms rather than the one specified in the command line. There is obviously something in the solution file that's causing this but personally I think this behaviour is wrong and is a bug.

The following command lines seem to worked irrelevant of what has been selected via the .NET IDE:

To only build a package for ARM in Release mode:

msbuild "c:\myapp\myapp.sln" /p:configuration=release;platform=ARM;
AppxBundle=Always;AppxBundlePlatforms="ARM"

To only build a package for x86 in Debug mode:

msbuild "c:\myapp\myapp.sln" /p:configuration=debug;platform=x86;
AppxBundle=Always;AppxBundlePlatforms="x86"

While the above works, irrelevant of what's selected in the .NET IDE, I haven't figured out how to build all platforms.

I'll also investigate the original command line problem and the link with via the .NET IDE selection, and I'll update my answer if I find out what's causing it.

Hope this helps.

Thierry
  • 6,142
  • 13
  • 66
  • 117
  • Thanks. It is rather annoying that the lack of specifying the AppxBundlePlatforms simply overrides and forces a build for all platforms. – Allan Smith Jun 20 '18 at 02:16