Problem solved after reading this GitHub issue from the native messaging demo repo. The cause of the error was that the path to the app manifest in the Registry key was incomplete; adding the file name of the app manifest file at the end of the path solved the problem.