Home Ask Login Register

Developers Planet

Your answer is one click away!

Mateusz Cisek February 2016

Building UWP app from command line

I need to create kind of builder for my Universal Windows App (UWP) application, that would load some configuration into it, build it and create app store package. Is there any way to build UWP app from command line, without associating it with the store and using Visual Studio at all?

There is WinAppDeployCmd, but it can be used to install builded appx package on device and I need tool like that to generate that package.


I've managed to build it and create app packages with command line, here is command I used:

msbuild "path to .csproj file" /p:OutDir=output_dir /p:AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM" /p:BuildAppxUploadPackageForUap=true

It's working but not as it should apparently. I can not install generated appx package on my phone (and emulator). I just get error

Failure reason: Failed to start deployment. Failure text: Install failed. Please contact your software vendor. (0x80073cf9)

I found many solutions for Windows 10 PC version, but there is only one solution I found for Windows 10 Mobile and this "solution" is to hard reset the phone, but I do not want to do that. Is there any other way?

And there is one more problem. This command doesn't work with parameter /p:Configuration=Release; and it only builds with Debug configuration, but I believe this is not related to previous error, because it doesn't work with Visual Studio either.


I could not find another solution, so I did the 'hard reset' of my phone and now it is working. It's sad, but I hope the reason is the Windows 10 Mobile OS is still in beta version.


Shafiq Abbas February 2016

Step 1 : See, you need to install .NET Framework installer from the below link. https://www.microsoft.com/en-us/download/details.aspx?id=30653

Step 2 : Go to C: drive and find where msbuild.exe is. You will find more msbuild. But mostly it will be in the location like C:\Windows\Microsoft.NET\Framework\v4.0.30319.

Step 3: Open the CMD in administrator and point to the location which is mentioned in Step 2.

Step 4 : Paste this. msbuild.exe "YourCompleteProjectPath.sln" /t:rebuild

See this for reference : https://msdn.microsoft.com/en-us/library/ms164311%28v=vs.85%29.aspx

Post Status

Asked in February 2016
Viewed 3,658 times
Voted 11
Answered 1 times


Leave an answer

Quote of the day: live life