Skip to content

Commit 1d49a18

Browse files
Fix outdated API names in Visual Studio grant-identity page
- PackageType.Main → PackageTypes.Main (correct enum name) - package.Id.FamilyName → package.Id.FullName (RemovePackageAsync requires full name) - Bump ms.date to 04/09/2026 Aligns VS variant page with corrected non-VS page. Addresses Copilot PR review feedback. Co-authored-by: Copilot <[email protected]>
1 parent e14e815 commit 1d49a18

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

hub/apps/desktop/modernize/grant-identity-to-nonpackaged-apps-visual-studio.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Grant package identity by packaging with external location in Visual Studio
33
description: How to use Visual Studio to grant package identity to an unpackaged Win32 app so that you can use modern Windows features in that app.
4-
ms.date: 05/09/2025
4+
ms.date: 04/09/2026
55
ms.topic: how-to
66
keywords: windows 11, windows 10, desktop, sparse, package, identity, external, location, MSIX, Win32, Visual Studio
77
ms.localizationpriority: medium
@@ -183,10 +183,10 @@ await packageManager.AddPackageByUriAsync(packageUri, options);
183183
184184
var packageManager = new PackageManager();
185185

186-
var packages = packageManager.FindPackagesForUserWithPackageTypes("", "<IdentityPackageFamilyName>", PackageType.Main);
186+
var packages = packageManager.FindPackagesForUserWithPackageTypes("", "<IdentityPackageFamilyName>", PackageTypes.Main);
187187
foreach (var package in packages)
188188
{
189-
await packageManager.RemovePackageAsync(package.Id.FamilyName);
189+
await packageManager.RemovePackageAsync(package.Id.FullName);
190190
}
191191
```
192192

@@ -225,11 +225,11 @@ await packageManager.ProvisionPackageForAllUsersAsync(packageFamilyName);
225225
// Unregister the identity package during uninstall
226226
227227
var packageManager = new PackageManager();
228-
var packages = packageManager.FindPackagesForUserWithPackageTypes("", "<IdentityPackageFamilyName>", PackageType.Main);
228+
var packages = packageManager.FindPackagesForUserWithPackageTypes("", "<IdentityPackageFamilyName>", PackageTypes.Main);
229229
foreach (var package in packages)
230230
{
231-
await packageManager.DeprovisionPackageForAllUsersAsync(package.Id.FamilyName);
232-
await packageManager.RemovePackageAsync(package.Id.FamilyName, RemovalOptions.RemoveForAllUsers);
231+
await packageManager.DeprovisionPackageForAllUsersAsync(package.Id.FullName);
232+
await packageManager.RemovePackageAsync(package.Id.FullName, RemovalOptions.RemoveForAllUsers);
233233
}
234234
```
235235

0 commit comments

Comments
 (0)