Search code examples
c#windows-phone-8windows-phone-8.1

Installation of the application failed. XAP package signature is not valid or the WP manifest file is invalid.


I have a WP8 app that I need to build in 3 configurations (release, release(prepro), release(fake)). Each configuration point to a different server and has different app icons. I need to be able to have all the 3 build in the phone at the same time so my solution is that I have created 3 different WMAppManifest.xml files (with different guids and icon paths) and I copy the right one in a pre-build step. This works fine (Based on this article http://www.tonicodes.net/blog/using-different-wmappmanifest-files-for-release-and-debug-builds/).

I upgraded the app to WP81 Silverlight. There is an additional Package.appxmanifest file. So I created 3 different Package.appxmanifest files, setting the PhoneProductId attribute to the right guid and added a pre-build step to do the copying also for this file.

When I try to run the app in release(prepro) or release(fake), meaning different WMAppManifest.xml an Package.appxmanifest are copied to the project first, I get

Installation of the application failed. XAP package signature is not valid or the WP manifest file is invalid. Re-sign with valid signature and fix the manifest file. 

Is there something other than PhoneProductId that I need to changed in the new Package.appxmanifest files to make work?


Solution

  • I found I needed to:

    1. Make the Package.appxmanifest Package > Identity > Name unique (as per @kjo4jc's answer)
    2. Change the Package.appxmanifest mp:PhoneIdentity > PhoneProductId GUID to differ from the value used in the store.
    3. The changed GUID also needed to be changed in wmappmanifest.xml Deployment > App > ProductID to match.