mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 22:13:23 -07:00
fix: handle picky Win11 ToastNotificationService
Exception: System.InvalidOperationException Message: Failed initializing notifications --- InnerException: --- Exception: System.IO.IOException Message: Ein dauerhafter Unterschlüssel kann nicht unter einem temporären übergeordneten Schlüssel erstellt werden. Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
This commit is contained in:
parent
a3e65fee6f
commit
5b40d2c0be
1 changed files with 10 additions and 1 deletions
|
@ -95,7 +95,16 @@ namespace Greenshot.Plugin.Win10
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare the toast notifier. Be sure to specify the AppUserModelId on your application's shortcut!
|
// Prepare the toast notifier. Be sure to specify the AppUserModelId on your application's shortcut!
|
||||||
var toastNotifier = ToastNotificationManagerCompat.CreateToastNotifier();
|
Microsoft.Toolkit.Uwp.Notifications.ToastNotifierCompat toastNotifier = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
toastNotifier = ToastNotificationManagerCompat.CreateToastNotifier();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Warn("Ignoring exception as this means that it was not possible to create a toast notifier.", ex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Here is an interesting article on reading the settings: https://www.rudyhuyn.com/blog/2018/02/10/toastnotifier-and-settings-careful-with-non-uwp-applications/
|
// Here is an interesting article on reading the settings: https://www.rudyhuyn.com/blog/2018/02/10/toastnotifier-and-settings-careful-with-non-uwp-applications/
|
||||||
try
|
try
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue