A Microsoft platform for building and publishing apps for Windows devices.
Exception on getting PackageId
I have a WPF app that I have converted to a bridge app. In this app I want to offer the user a function to open any installed store app in the store. For this I need the ProductId of an app to create the following url:
ms-windows-store://pdp/?productid=<ProductId>
I have tried the following. Unfortunately I get an InvalidCastException when accessing Package.Id.
PackageId packId = AppInfo.GetFromAppUserModelId("Microsoft.3DBuilder_8wekyb3d8bbwe!App").Package.Id;
string productId = packId.ProductId;
System.InvalidCastException in mscorelib:
The object of type "Windows.ApplicationModel.PackageId" cannot be converted to type "Windows.ApplicationModel.IPackageIdWithMetadata".
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW_WinRT(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget)
at Windows.ApplicationModel.PackageId.get_ProductId()
Is there possibly another way to get the ProductId of any application?
Developer technologies | Universal Windows Platform (UWP)
Developer technologies | Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.