Unhandled exception - winrt::hresult_class_not_registered at memory location
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.
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".
In the dialog that appears, choose "cpp-console-package" from the dropdown under Single Startup Project.
Click OK, and try launching the project again.
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!