How to fix Exception thrown: 'System.UnauthorizedAccessException' in WinRT.Runtime.dll

John Carroll 0 Reputation points
2023-09-06T18:32:59.97+00:00

When calling BluetoothLEAdvertisementPublisher.Start(), I get "Exception thrown: 'System.UnauthorizedAccessException' in WinRT.Runtime.dll". This is an unpackaged version of the app with FullTrust. Even so, I have added 'bluetooth' to the capabilities in the Package.appxmanifest. This same code works under UWP, and WPF. What else can I do to enable BluetoothLEAdvertisement publishing in Win UI 3?

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
780 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,439 questions
{count} votes

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.