Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Our app suddenly fails to show toast notifications #5016

Open
reiseder opened this issue Mar 7, 2025 · 0 comments
Open

Our app suddenly fails to show toast notifications #5016

reiseder opened this issue Mar 7, 2025 · 0 comments

Comments

@reiseder
Copy link

reiseder commented Mar 7, 2025

Our app suddenly throws an UnauthorizedAccessException when trying to show a basic toast notification.

It worked fine until a few days ago, so my question would be if this was cause by a Windows update or just our IT department changing something?

The app runs with elevated rights.

It would be great if anybody knows what this registry key is used for?


Exception message:

Failed initializing notifications

Stack trace:

   at Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat.CreateToastNotifier()
   at Microsoft.Toolkit.Uwp.Notifications.ToastContentBuilder.Show(CustomizeToast customize)
   at Microsoft.Toolkit.Uwp.Notifications.ToastContentBuilder.Show()
   at <REDACTED METHOD> in <REDACTE FILE>:line 200
   at <REDACTED METHOD> in <REDACTE FILE>:line 172
   at System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()

Inner exception message:

Access to the registry key 'HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{5a99e422-303c-ea88-3583-506ae78a9819}\LocalServer32' is denied.

Inner exception stack trace:

   at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
   at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions registryOptions)
   at Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat.RegisterComServer(Type activatorType, String exePath)
   at Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat.RegisterActivator(Type activatorType)
   at Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat.CreateAndRegisterActivator()
   at Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat.Initialize()
   at Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat..cctor()

This is how we show the toast notification

private void ShowMessage(string message)
{
    new ToastContentBuilder()
        .AddArgument("action", "viewConversation")
        .AddArgument("conversationId", SomeIdProperty)
        .AddText(SomeProductNameProperty)
        .AddText(message)
        .Show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant