microsoft / microsoft/WindowsAppSDK
Application notification manager throws on a partial trust application
- Dominant language
- C++
- Stars
- 4.7k
- Forks
- 471
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 28
Description
### Describe the bug
The [AppNotificationManager](https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.appnotificationmanager?view=windows-app-sdk-2.0) fails to work on a partial trust application WinUI 3 project despite [AppNotificationManager.IsSupported](https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.appnotificationmanager.issupported?view=windows-app-sdk-2.0) returning true.
Calling [AppNotificationManager.Register](https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.appnotificationmanager.register?view=windows-app-sdk-2.0) throws `System.Runtime.InteropServices.COMException: 'Unspecified error No COM servers are registered for this app'`.
Calling [AppNotificationManager.Show](https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.appnotificationmanager.show?view=windows-app-sdk-2.0) throws `System.Runtime.InteropServices.COMException: 'The request is not supported. The request is not supported.'`.
### Steps to reproduce the bug
1. Create a MSIX packaged WinUI 3 project.
2. Change `EntryPoint`'s value to `windows.partialTrustApplication`.
3. Comment out the `runFullTrust` & `systemAIModels` capabilites.
4. Call `AppNotificationManager.Register` (In `OnLaunched` before window activation) and/or `AppNotificationManager.Show`.
5. Observe the imminent existence of an exception.
### Expected behavior
A regular Windows notification showing up.
### Screenshots
_No response_
### NuGet package version
2.1.3
### Packaging type
Packaged (MSIX)
### Windows version
Windows 11 version 23H2 (22631, June 2025 Update)
### IDE
Visual Studio 2022
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the failure in a packaged WinUI 3 project whose EntryPoint is windows.partialTrustApplication and whose runFullTrust and systemAIModels capabilities are disabled. Trace AppNotificationManager.Register and Show with AppNotificationManager.IsSupported; done means a regular Windows notification appears without either COMException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100