-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ToastNotificationManagerCompat: Cannot create a stable subkey under a volatile parent key #4858
Comments
Hello caobug, thank you for opening an issue with us! I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌 |
@caobug the Windows App SDK Notifications APIs should handle most scenarios now. Have you tried your scenario with them? |
We have encoutered the same issue Flow-Launcher/Flow.Launcher#2054. Possibly Windows 11 22621.1413 or 22621.1485 breaks something since we started receiving reports in the past few weeks.
Could you give some advice or document on migrating to Windows App SDK Notifications APIs? |
I see the same thing happening in my app. Although my observations would suggest that it's not a matter of the Windows build version per se, as I have three machines here with the same build (22621.1555) and on two of them, the error does not appear, on the third one it does. |
Looking at your code, the error is probably in this line: Line 153 in 63cbb4a
If I haven't found a good way to check whether a key is volatile, so one possible solution would be to surround this call with a try/catch block and if the call fails, try again to create the subkey as a volatile key: |
I'm facing the same problem, all WINDOWS 10.0.22621 in my case. From what I see @ThomasSuHo is correct with the line that is throwing the error. |
I am seeing this issue as well with Microsoft.Toolkit.Uwp.Notifications 7.1.2 on 22621.1778. In our specific case it is after an install of our application. A reboot appears to fix the issue. |
In the case where upgrading to Windows APP SDK is not feasible... Did something change in the OS to break this functionality? Also if this is nuget package is not valid can the documentation be updated to reflect that - On https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/toast-desktop-apps and https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/send-local-toast?tabs=uwp I see no indication that this nuget package is no longer supported. |
I think I am seeing this one random machines I have deployed the app to - most work fine. I'll see if rebooting helps (but typically I can't reproduce it on any of my machines, so I need a friendly end-user to help). Framework Version: v4.0.30319 |
@michael-hawker I think, this issue needs a higher priority because the description is basically "on some machines, notifications won't work at all". |
We have this exact problem with the newest Windows 11 version in an Intune managed environment. An application using this toolkit crashes with the same error. We were able to start the application using the Windows 8 compatibility mode. We have no idea what the exact problem is. |
I have wrapped all uses of the code in try/catch blocks so my app works (albeit without notifications on a number of machines).
|
Our product is also encountering this with high frequency from some of our users. |
Folks, as I mentioned at the top of the thread, the Windows App SDK notification API is the path forward, have you tried migrating to that solution and seeing if the same issue occurs? If so, please file an issue at their repo here: https://github.com/microsoft/WindowsAppSDK |
@michael-hawker That is fine to try for a path forward. However, we have software in the field that is experiencing this issue only on certain environments. Those on this thread are likely looking for a fix from Microsoft that doesn't involve modifying the already delivered software. |
@michael-hawker I agree with @smithmw. This functionality worked on prior versions of Windows. We have our application running on 10k+ endpoints. Refactoring our code and pushing a patch because something broke between versions of Windows is not ideal. Especially since the last version of this package was in November and it is not marked as deprecated. |
@michael-hawker Could this nuget package be refactored to use Windows App SKD notification API? It would allow development teams to continue using the package and upgrade to Windows App SDK at their leisure. |
@smithmw @Daniellled if there's a bug with Notifications in Windows it should be reported I believe in Feedback hub so that the OS can be patched; if you've done so and can link here, we can try and connect the dots to the notifications team that owns these APIs. All work is being done on the new notifications API in the Windows App SDK, that is the current version of this API. We have plans to deprecate packages and point to the 1.4 version of the Windows App SDK when it ships. We have no plans to patch the current codebase nor attempt to polyfill these APIs. I've been told the API surface is very similar between the Toolkit and the new APIs (as they were designed from one another by the same group, just shipped in different places). Upgrading to the new API is the best path forward. FYI @robertzhou-wpn |
So I attempt to update my WPF project to use Windows App SDK and I run into this error microsoft/microsoft-ui-xaml#5689. I am guessing that Windows App SDK and WPF WebView2 are not compatible? |
Are we really supposed to add a 75MB nuget package containing all of WinUI 3 just to get the fixed Notifications API that's being shipped in it? This hurts using native notifications from WPF apps (supposedly still actively supported by microsoft :^) ) quite badly. |
It was already a pain in the behind to get this working even a little and when I finally got it all configured right now this error, really needs a fix or an easier way to access notifications in WPF, this is such basic functionality, I'm baffled why it has to be so difficult. @michael-hawker Issue also happens on the "Windows App SDK notification API" method you linked btw. |
Great, until this gets fixed, we are basically left with no notifications. Does anybody know another way? |
Thanks @mavanmanen for opening the issue on the platform repo, I've raised it up with the notifications team. Since microsoft/WindowsAppSDK#3771 is tracking this problem now in the platform, I'm going to close this issue. I've asked them to respond with more information on that issue.
@Daniellled that issue you linked may look similar, but it sounds different from what you're describing as it involves Microsoft Graph and not just WebView2. Can you file an issue in the Windows App SDK repo describing your issues having a WPF app using WebView2 referencing the Windows App SDK (feel free to still point to the links above as related). Thanks! |
Describe the bug
Hi, I'm currently referencing "Microsoft.Toolkit.Uwp.Notifications" in WPF project to send local notifications and this works fine on most devices. but on a small number of computers, a "RegistryKey.Win32Error" error will be thrown.
I can be sure that I'm operating on the main thread. I had to use "try catch" to catch the exception, but this way I can't display the notifications on the target computer.
Source Code:
Erros:
Regression
No response
Reproducible in sample app?
Steps to reproduce
Expected behavior
Normal display notifications.
Screenshots
No response
Windows Build Number
Other Windows Build number
10.0.22621
App minimum and target SDK version
Other SDK version
10.0
Visual Studio Version
2019
Visual Studio Build Number
16.11.25
Device form factor
Desktop
Nuget packages
Microsoft.Toolkit.Uwp.Notifications 7.1.3
Additional context
No response
Help us help you
Yes, but only if others can assist.
The text was updated successfully, but these errors were encountered: