Is it possible to use WNS without the Windows App SDK in a native C++ WinUI 2 XAML-hosted application?

Rohan Pande 515 Reputation points
2026-07-09T10:00:03.84+00:00

Hi,

I'm building a native C++ desktop application that hosts XAML content. The application is currently unpackaged, and I'd like to implement Windows Push Notifications.

While researching, I couldn't find any documentation that explicitly states whether Windows Push Notification Services (WNS) require the Windows App SDK, or whether there's a supported native Win32 approach without it.

I was able to implement Windows Push Notifications in a WinUI 3 application (unpackaged) using the Windows App SDK.

However, my another variant application uses WinUI 2 (XAML hosting), and I'm trying to understand whether the Windows App SDK is actually required for WNS or whether there's a supported alternative for this scenario.

Could someone please clarify the following?

  1. Does using WNS require the Windows App SDK, or can it be used directly from a native Win32/C++ application
  2. If WNS can be used without the Windows App SDK, is it supported for unpackaged / packaged with external location desktop applications?
  3. If the Windows App SDK is required, is that because WNS itself depends on it, or because the SDK provides the supported client APIs for desktop applications?
  4. Are there any official Microsoft documents that describe these requirements and supported scenarios?

I wasn't able to find documentation that clearly answers these questions, so any clarification or pointers to the relevant documentation would be greatly appreciated.

Thank you!

Windows development | Windows API - Win32

Answer accepted by question author
Taki Ly (WICLOUD CORPORATION) 5,055 Reputation points Microsoft External Staff Moderator
2026-07-10T04:27:34.0066667+00:00

Hello @Rohan Pande ,

To double-check this behavior, I built a quick native C++ Win32 repro without the Windows App SDK. While it compiles perfectly using just the Windows SDK, calling PushNotificationChannelManager::CreatePushNotificationChannelForApplicationAsync() in a truly unpackaged process results in an HRESULT 0x80070490 (Element not found) error. However, when I packaged that exact same executable with external location (sparse packaging) and ran it again, the API successfully requested and received a channel URI from WNS. This confirms that if your app is truly unpackaged, invoking this native API directly from C++ will typically fail, but granting it an identity unlocks the native feature.

The reason the Windows App SDK is often mentioned in these scenarios is that it provides an alternative client API (Microsoft.Windows.PushNotifications.PushNotificationManager). This alternative approach leverages Azure Active Directory for identity, essentially bypassing the OS's strict package identity requirement.

Regarding your deployment scenarios, if you prefer to use WNS without the Windows App SDK, your application would need to be either MSIX packaged or "packaged with external location". This approach grants your Win32 application the necessary package identity while allowing you to keep your existing executable and custom installer. Truly unpackaged apps without the SDK would generally not be supported for WNS.

On the other hand, if you choose to use the Windows App SDK to handle notifications, it might be helpful to note that you don't actually need to migrate your UI to WinUI 3. You can simply integrate the SDK into your existing Win32/WinUI 2 project. However, please keep in mind that for a completely unpackaged app, the App SDK's push notifications only support limited functionality, primarily foreground notifications without background COM activation.

For further reading, I'd suggest taking a look at a few specific Microsoft documents that outline these nuances:

I hope this helps clarify the underlying requirements and provides some guidance on whether to adopt sparse packaging or integrate the App SDK for your current architecture. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.

Thank you.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Oldest

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.