Which PhoneProductId to use for a UWP app that is not an upgrade

1

I am developing a new UWP application for Windows 10 Desktop and Mobile. The PhoneIdentity appears to be a mandatory entry in the .appxmanifest file. While the MSDN is explicit about what the PhoneProductId should be, if the app is an upgrade, it doesn't explain what value to use, in case it is not.

Since this application is not an upgrade my first instinct was to use a null GUID (00000000-0000-0000-0000-000000000000). Doing so caused Visual Studio to return an error when trying to deploy the app for debugging:

1>------ Deploy started: Project: MyApp, Configuration: Debug ARM ------
Deploying to Phone Internal Storage...
Updating the layout...
Copying files: Total <1 mb to layout...
Checking whether required frameworks are installed...
Registering the application to run from layout...
DEP0700: Registration of the app failed. [0x80073CF6] Package could not be registered. (Exception from HRESULT: 0x80073CF6)
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Setting the PhoneProductId to a random GUID appears to solve the deployment issues, although without any documentation I'm a bit uneasy about doing something, that appears to work, without knowing why it works.

Is there a specific GUID to use for an app that is not an upgrade? If not, does this GUID need to follow any particular protocol (e.g. a specific version or type, or generated off of the app Identity Name)?

uwp
windows-10-universal
windows-10-mobile
appxmanifest
asked on Stack Overflow Apr 29, 2018 by IInspectable • edited Apr 29, 2018 by IInspectable

1 Answer

1

It's just a normal GUID; you can copy it from your app's main identity.

Look in C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ProjectTemplates\CSharp\Windows UAP\1033\BlankApplication\Package-managed.appxmanifest (path may be slightly different depending on which VS version you're using). This file shows that both the Identity and the PhoneIdentity are set to $guid9$:

<Identity
  Name="$guid9$"
  Publisher="$XmlEscapedPublisherDistinguishedName$"
  Version="1.0.0.0" />

and

<mp:PhoneIdentity PhoneProductId="$guid9$" 
  PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Presumably GUIDs 1 through 8 are used for something else :). You can see from the Project Template docs that it's just a GUID. Nothing special

answered on Stack Overflow Apr 30, 2018 by Peter Torr - MSFT

User contributions licensed under CC BY-SA 3.0