This sample packages a UWP app and a WinUI 3 desktop app together by using a Windows Application Packaging (WAP) project. The UWP app acts as the entry point and can redirect activation to the WinUI 3 app, which makes the solution useful for exploring migration strategies and packaged scenarios that still rely on capabilities more readily available in UWP.
PackageMultipleApps
|-- WinUi3App/ C++/WinRT WinUI 3 desktop app
|-- UwpApp/ C++/WinRT UWP redirector app
|-- AppPackaging/ WAP packaging project
|-- ControlsLib/ Native shared controls library
|-- ControlsLib.CS/ Managed shared controls library (ControlsLibCs)
`-- ControlsLibCs_Dep/ Supporting managed dependency project
- The solution mixes C++/WinRT desktop and UWP app models in a single packaged deployment.
WinUi3Appis the WinUI 3 desktop experience that ultimately handles the redirected activation.UwpAppserves as the packaged entry point and can front-load activation scenarios before handing off to the desktop app.AppPackagingis the project that ties the applications and libraries into one deployable package.ControlsLib,ControlsLibCs, andControlsLibCs_Depshow how shared native and managed assets can live alongside the two app models.- This setup is primarily interesting for compatibility and migration experiments rather than for a minimal production architecture.
In theory this should allow us to unlock a few unsupported features on WinUI 3, like:
- Keep ProgId when updating UWP app to WinAppSdk which is not yet supported fully (i.e. your app might display "New" on OpenWith after updating it)
- Support AutoPlay manifest declaration in UWP since WinUI still does not support it
- Startup perf impact since the UWP app always need to be launched before launching the WinUI 3 App
RuntimeBroker.exemight be running even though the UWP App redirector have exited but WinUI 3 app is still running- Customize the entire activation
- Customize the
AppandResourcesname to avoid conflict when packaging 2 apps together (i.e.App.xamlneeds to be renamed toApp2.xamlin one of the apps)
- Open
PackageMultipleApps.slnin Visual Studio 2022. - Restore dependencies and ensure the UWP, C++ desktop, and Windows App SDK workloads are installed.
- Choose a packaged configuration such as
Debug|x64,Debug|ARM64, or the matching release configuration. - Build the shared libraries first or build the full solution so all app and library dependencies are produced together.
- Deploy
AppPackagingto test the combined package and activation redirection flow.
Use this sample when you want to study tradeoffs in packaging multiple Windows app models together during a migration to WinUI 3.