Click here to Skip to main content
15,506,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello and thanks in advance,

i have a problem with a WPF Application using the ToastNotificationManager class:
The ToastNotificationManager class needs an App Identity.
I found this solution which seemed to work fine at the beginning:
https://www.thomasclaudiushuber.com/2019/04/26/calling-windows-10-apis-from-your-wpf-application/

In the section "Create an Identity for Your WPF App" Thomas described detailed how to add a Windows Application Packaging Project to my solution as startup-project to have an Identity for my app.
This worked very well.
But only in the development Environment - when i start and test my application from within the Visual Studio 2019 environment!
As soon as i publish the app  (using the produce-single-file option), it does not work.

The errors i get point exactly in the direction that the App Identity is missing. The error occurred after calling the method "ToastNotificationManager.CreateToastNotifier ()".

Does anyone have an idea why the solution with setting the app id with the additional Application packaging project as start project does only work when calling the app from the Visual Studio Environment? And how i could solve it so that it runs even as published exe file ?

Thank you very much for your advice !

Best regards
Emanuel


What I have tried:

I have two ideas - but i'm a very beginner in C#, so i assume you have better ideas ;-)
1. Create an app ID manually. But i cannot find a good solution, how i can create such an id manually, seems to be rather complex
2. Maybe i could try to transform my app into an UWP application - then i would have no problem with the app ID. But i started with UWP and reached limits, so that i switched over to WPF. So maybe other parts of my applicatoin won't work if i switch back to UWP...
Posted
Updated 23-Aug-21 22:41pm
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900