Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild always build all platforms even when specific one provided

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.

like image 975
Thierry Avatar asked Dec 17 '25 17:12

Thierry


1 Answers

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.

like image 192
Thierry Avatar answered Dec 19 '25 13:12

Thierry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!