How to obtain access to 'HumanPresenceSettings. SetingsChanged'

charles yu 1 Reputation point
2025-02-17T07:55:28.4633333+00:00

The "HumanPresenceSettings" instance I returned through this method, 'humanPresenceSettings=await HumanPresenceSettings. GetCurrentSettings Asynchronous ()', can read the relevant settings. However, when I subscribe to 'HumanPresenceSettings. SetingsChanged' or call the 'HumanPresenceSettings. updateSetes()' method, it throws an exception 'Access is denied.' (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). What else do I need to do?

UWP Package.appxmanifest:

<Capabilities>

<Capability Name="internetClient"/>

<DeviceCapability Name="webcam"/>

<DeviceCapability Name="humanPresence" />

</Capabilities>

windows Settings:User's image

Developer technologies | Universal Windows Platform (UWP)
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Harry Vo (WICLOUD CORPORATION) 405 Reputation points Microsoft External Staff
    2025-08-05T04:01:50.06+00:00

    Hi @charles yu

    My name is Harry, Support Engineer who specialize in UWP (Universal Windows Platform). Thank you for reaching out on Microsoft Q&A!

    Some APIs like HumanPresenceSettings often require your UWP app to be installed via the full app deployment pipeline. Just debugging from Visual Studio may not grant full permissions to them. So, you can try creating app package and install via Add-AppxPackage to see if it works (make sure it is signed and installed with appropriate certificate).

    You can also try using this line to verify what is actually available:

    humanPresenceSettings = await HumanPresenceSettings.GetCurrentSettingsAsync();
    var watcher = HumanPresenceSensor.GetDeviceSelector();
    

    I hope this helps you get things back on track quickly! If my suggestions can solve your issue, feel free to interact with the system accordingly!

    Thank you!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.