Trouble implementing restricted capability (Packages)

Dylan Sukha 1 Reputation point

So I was following this. I'm building a 'launcher' app that lets the user view and run their installed software. I managed to get this exception. It also throws some problem about getting denied by WinRT.

Exception: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Windows.Management.Deployment.PackageManager.FindPackages() at launcherproto.MainPage..ctor()

I see a blue line under Capability that regards to referencing.

< rescap:Capability Name="packageQuery" />

Any guess on what I'm doing wrong?

Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 29,356 Reputation points Microsoft Vendor


    Welcome to Microsoft Q&A!

    According to the document: FindPackages(String, String) Method requires administrative privileges. That's why you get the access denied exception.