I have created win32 .Net desktop application. I want to create appx bundle for my solution on every post-build event using makeappx.exe tool. When I am running command on post build event : MakeAppx pack /d input_directorypath /p filepath.appx ,it fails with error code 9009. I don't know why this is giving error as when I run this command using developer command prompt, it gives desired output. I also noticed that when I run above command using normal command prompt it gives same error. Please help on this.
Asked
Active
Viewed 871 times
1 Answers
0
I have tested your command and reproduced your issue. The problem is that when you run command on post build event, it did not found makeappx.exe
tool. The command is incomplete. Below is a complete command.
"C:\Program Files (x86)\Windows Kits\10\bin\x64\MakeAppx.exe" pack -d "C:\test1\VLCUWPApp\PackageFiles" -p "C:\test1\VLCUWPApp\VLCUWPApp.appx"
For your requirement, you could add C:\Program Files (x86)\Windows Kits\10\bin\x64
path to Environment Variables, and then
you could successfully run the command that you have mentioned.
Please note if the appx package already exists in destination path, the post build event will be stuck. Because it's waiting for you to input "Y" to cover the old package. However, currently it did not provide inputting interface. So you should remove the old package manually.

Nico Zhu
- 32,367
- 2
- 15
- 36
-
Thanks for the input,Nico. I got this. After setting environment variable and running the command as "C:\Program Files (x86)\Windows Kits\10\bin\x64\MakeAppx.exe", I am getting desired output. But when I run "MakeAppx.exe" even after setting environment variable, it won't recognize command. Also we can specify /O attribute in makeappx command to override existing appx.Then we won't need to delete earlier appx manually on every post build event. – Ankush Butole Jul 19 '17 at 07:34
-
If you have set environment variable. Please try to run `makeappx pack -d "C:\test1\VLCUWPApp\PackageFiles" -p "C:\test1\VLCUWPApp\VLCUWPApp.appx" ` command, not "MakeAppx.exe". – Nico Zhu Jul 19 '17 at 07:46