WindowsAppSDK-Samples icon indicating copy to clipboard operation
WindowsAppSDK-Samples copied to clipboard

Unhandled exception - winrt::hresult_class_not_registered at memory location

Open ankurbhambri opened this issue 1 year ago • 1 comments

I'm Encountering the following error while running the packaged C++ console application for push notifications. I have created a simple C++/WinRT Windows console application and facing the below error while running the code.

Unhandled exception at 0x00007FF90AC5FABC in ConsoleApplication.exe: Microsoft C++ exception: winrt::hresult_class_not_registered at memory location 0x000000BB6474EB68.

image

ankurbhambri avatar Aug 04 '24 07:08 ankurbhambri

Hello! Thanks for filing an issue. This error often happens when the console project is set as the startup project instead of the packaging project (cpp-console-package). Here's how to fix it:

Click the small arrow next to the play button, then select "Configure Startup Projects".

Image

In the dialog that appears, choose "cpp-console-package" from the dropdown under Single Startup Project.

Image

Click OK, and try launching the project again.

Image

You should now see "Local Machine" next to the play button. Click the play button, and the project should build successfully and open a console window. Let us know if you need any clarification or run into other issues—we’re happy to help!

lauren-ciha avatar Aug 09 '25 01:08 lauren-ciha