Preface
This article sorts out the relationship between WinUI 3, Project Reunion and the Windows App SDK, and details how to create an Unpackaged App supported in the Windows App SDK version 1.0.
Windows App SDK 1.0
Project Reunion is a unified toolset for next-generation Windows App Development. In November 2021, when the third stable version was officially released with the version number 1.0, the renaming department took decisive action to welcome 2022 and Windows 11 with a new name Windows App SDK.
After a soft-recommended UWP developer migrated to the Windows App SDK, there was a wave of news of "abandoning" UWP. In fact, after experiencing WPF, Silverlight, UWP UI frameworks that look like (XAML), it is not very difficult for developers to upgrade to Windows App SDK and WinUI 3. After all, this has collected four ways of writing XAML. Can it be called giving up when it comes to writing code? The air was suddenly filled with the smell of joy...
Let’s talk about WinUI 3, which cannot be avoided in the Windows App SDK. WinUI 3, as the most core and key part of the Windows App SDK, is the native UI framework for the development of the next-generation Windows desktop app, including managed C# and unmanaged C++ and Win32 API. It can be understood as a soft reflection and integration of desktop development technology in the past two decades.
With the iteration of the version, the current positioning of WinUI 3 has some changes earlier. Unlike WinUI 2, which is dedicated to UWP, WinUI 3 does not want to be associated with UWP now.
The description of UWP support in the earlier preview version has been hard to find, which can be understood as narrowing the scope of support and focusing on Make Desktop Great Again! Based on the experience with the current version, there are two points worth noting. First of all, in terms of version 1.0, there are still no substitutes for components that are quite useful in the UWP era, such as CameraCaptureUI, InkCanvas and PrintManager. The second is the version limitation of Win10 1809+. It is conceivable that for software running on Win7 or even older systems, the upgrade is almost completely rewritten.
Unpackaged App
A very interesting point of Windows App SDK 1.0 is support for Unpackaged App. Unlike the previous guesses without responsibility, the support for Unpackaged App is very thorough this time, and it is very convenient to use. Unpackaged App is no longer packaged and uploaded to the store in the MSIX format, but completely returns to the .exe or .msi installation method.
Then we use VS 2022 to create the long-lost exe program. In addition to VS 2022, we need to additionally install Windows App SDK runtime and MSIX packages.
After the download is complete and decompressed, select the corresponding installation file according to the computer environment. For example, I am a 64-bit Win11 system, I choose WindowsAppSDK-Installer-x64, and the installation will be automatically completed after double-clicking.
After completing the above preparations, create a Blank App, Packaged (WinUI 3 in Desktop) project in VS2022. Students who have experienced the trauma of UWP DesktopBridge may find that even Packaged App no longer needs an additional Packaging Template project. The simple and single solution interface makes people feel a lot better.
Then let us right-click and select Edit Project File. In the Project File Editing window, add a WindowsPackageType node and set it to None.
<WindowsPackageType>None</WindowsPackageType>
The last step is to select the Unpackaged startup profile in the drop-down list of Start Debug. So far, our first exe program using Windows App SDK is ready. Click the button to start Debug or press F5 to run successfully.
So the name implies Unpackaged App, we can run it directly in the Output directory, or in the Publish directory by double-clicking the exe. As shown in the figure below, after successful publishing, you can copy the entire publish directory to run on other Win10 1809+ machines.
Fly in the ointment The current version will contain a large number of Dll files in the pulish directory. The machine running the exe program at the same time also needs to install the Windows App SDK Runtime. In a trance, I went back to the scene of installing .NET Runtime on XP twenty years ago. History is really a reincarnation.
This is a small step for us to experience Windows App SDK 1.0. At the same time, we wish that this is a solid starting point for Make Desktop Great Again built by a software company, and a new brilliant future for Windows and many silent desktop developers. A big step.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。