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:
In the section "Create an Identity for Your WPF App" Thomas described detailed how to add a Windows Application Packaging Project to my solution and set it as startup-project to have an Identity for my app.
This worked very well.
But only in the development Environment - if i start and test my application out of the Visual Studio 2019 environment.
As soon as i publish the app (using the produce-single-file option), it does not work anymore.
The errors pointed exactly in the direction that the App Identity was 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 ?
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...
Thank you very much for your advice !
Best regards
Emanuel
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:
Calling Windows 10 APIs From Your WPF Application
Did you know that you can call Windows 10 WinRT APIs from your WPF and WinForms apps? In this blog post I'll show you how to display toast messages from a WPF application by using the Windows 10 ToastNotificationManager. In the previous blog post you…
www.thomasclaudiushuber.com
In the section "Create an Identity for Your WPF App" Thomas described detailed how to add a Windows Application Packaging Project to my solution and set it as startup-project to have an Identity for my app.
This worked very well.
But only in the development Environment - if i start and test my application out of the Visual Studio 2019 environment.
As soon as i publish the app (using the produce-single-file option), it does not work anymore.
The errors pointed exactly in the direction that the App Identity was 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 ?
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...
Thank you very much for your advice !
Best regards
Emanuel