How to access registry key in a UWP app?

If your app is a pure UWP app, this is not possible. UWP apps were built with the goal of being lightweight and avoid registry as much as possible, so your app cannot access the registry at all (although some registry keys are created by the system when the app is installed, like URI protocol registration, etc.).

If you really needed to access the registry and don’t need to publish your app on Microsoft Store, you could implement a Brokered Windows Runtime Component. This allows you to call on full-trust .NET Framework libraries from UWP which in turn can access the registry. However, app using Brokered Components will not pass certification.

Finally, if your app is a UWP Desktop Bridge app, you have access to the registry – see documentation.

Leave a Comment