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)?

IInspectable
  • 46,945
  • 8
  • 85
  • 181
  • @ShubhamSahu: I am not updating the app from Windows Phone. This is a fresh UWP project. The fields `Package/Identity/Name`, `Package/Identity/Publisher`, and `Package/Properties/PublisherDisplayName` have the correct entries taken off of the Windows Developer Dashboard. When associating the app with the store, the `PhoneProductId` is not filled in automatically. – IInspectable Apr 29 '18 at 14:12
  • @ShubhamSahu: I'm not asking for a solution that appears to work. I have already fumbled something together that does. I'm looking for solid facts, documentation at best, telling me, what value to use. After all, I have no idea, how that GUID was generated. Who knows, maybe it is a hashed value of your `Package/Identity/Name`. – IInspectable Apr 29 '18 at 14:32
  • When you create a new project, apparently visual studio assigns a new random GUID to the PhoneProductId in Package.appxmanifest. I don't think it should be anything special since I've developed multiple UWPs (not upgrades) and never cared about it. No problems so far after a few years. – Mehrzad Chehraz Apr 29 '18 at 21:23
  • @MehrzadChehraz: I'm using C++/WinRT. There are no C++/WinRT project templates. Can you post one of your auto-generated GUIDs so that I can at least determine, what type they are. – IInspectable Apr 29 '18 at 22:14

1 Answers1

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

Peter Torr - MSFT
  • 11,824
  • 3
  • 18
  • 51
  • 1
    That (kind of) implies, that `Package/Identity/Name` and `Package/mp:PhoneIdentity/PhoneProductId` should be the same. At least for an individual developer license, the `Package/Identity/Name` is not a GUID, though. I wish the details were explicitly spelled out in the documentation, although I believe you are correct, that the only requirements for that GUID are, that it is unique and not used to identify a package in the Windows Phone Store. – IInspectable Apr 30 '18 at 08:06
  • Well they need to put something unique in the project template even so you can just F5 the solution, so a Guid is better than most things. Project names like `WindowsApplication1` aren't very unique on most dev boxes ;-) – Peter Torr - MSFT May 01 '18 at 14:10
  • 1
    That's understood, although it somewhat invalidates your answer. If the auto-generated value for `Package/Identity/Name` is good enough for testing, even if not ultimately correct, then the same goes for the `Package/mp:PhoneIdentity/PhoneProductId`. As always, code is not the same as documentation. I'm going to have to unaccept this answer for now, until the [documentation issue](https://github.com/MicrosoftDocs/winrt-related/issues/19) has been resolved. Anyway, this answer helped me understand what value is used in a wizard-generated project, so the up-vote is still justified. – IInspectable May 01 '18 at 15:52