simon_bisson
Contributor

Microsoft inches closer to unified Windows SDK

analysis
Mar 31, 20217 mins
C#Microsoft .NETSmall and Medium Business

The latest preview bits of Microsoft’s Project Reunion for building Windows 10 desktop applications are ready for testing and even for production.

Microsoft Windows 10X [logo]
Credit: Microsoft

Microsoft’s plan to decouple the Windows developer platform from the OS has reached its first major milestone with the 0.5 release of the Project Reunion SDK. It’s the first release to mix in the WinUI 3.0 UI controls, with Microsoft describing it as “the first round of validating our work with customers prior to release.” It’s also the first release that lets you publish MSIX-packaged desktop apps to the Windows Store.

Although the 0.5 release has production support for a subset of its planned APIs and just one of its intended development targets, Microsoft is encouraging developers to get started porting apps to the new platform. Project Reunion won’t be the only way to get access to Windows APIs; the Windows SDK isn’t going away and will continue to evolve with Windows. Rather, Project Reunion is a way to find a common platform for access to that SDK and to the Windows UI layer. By providing that common layer, Project Reunion should make it possible to bring older code forward to take advantage of Windows 10’s security features along with access to modern hardware and services.

Another aspect of Project Reunion is support for as many different ways of building code for Windows as possible. APIs will be available in WinRT for .NET applications and as native C for C++/Win32. Currently, the available builds include C# for .NET 5 and C++ with WinRT. Microsoft is looking to the future and is offering a Rust/WinRT build for developers experimenting with the memory-safe language. Significant investment is going into Rust, and early support for Project Reunion will allow you to quickly get up to speed with modern development practices in a new language.

Project Reunion is hosted on GitHub, with installation instructions and links to documentation, as well as community access to source code.

Understanding MRTCore and DWriteCore

Part of Project Reunion is a new version of the Windows Resource Management System, MRTCore. This indexes all the resources in a package at build time, adding the index to your app’s package. These indexes give you programmatic access to resources, with a loader class for access to string resources and a ResourceManager class for deeper information about application resources. You can then use these tools to manage access to files bundled with your code, including images and other media resources.

One use for MRTCore is to keep different versions of application resources for different target devices, for example detecting screen resolution when an application runs and then loading the appropriate resolution icons and images so that users get the best match for their PC. Users with high DPI displays will be able to get an appropriate user interface without unnecessary scaling.

Another featured API is DWriteCore, a rewrite of the DirectWrite APIs with support for all Project Reunion target OSes. It’s intended to provide the same rich text layout tools, with no need to worry about different features for different versions. This is a change from how DirectWrite has implemented new features, with each new release adding incompatibilities with older versions. As Project Reunion is intended to not only support Windows 10, but to bring code to older operating systems, using DWriteCore for text layout should help avoid compatibility issues.

If you’re familiar with DirectWrite, you won’t have any difficulty switching to the new APIs. Most are the same, with DWriteCore adding a handful of new APIs. Some are polyfills to get around cross-platform restrictions, like a new glyph-rendering target for bitmaps. Others allow you to restrict usage to only working with common fonts, avoiding the risk of needing to deliver new fonts to older PCs. Although this does make it harder to use nonstandard fonts, it can make your code more consistent with the Windows look and feel, and with the new WinUI 3 controls.

Project Reunion and WinUI 3

One of the more important aspects of this release is support for WinUI 3, with a version that’s ready for use in production applications. Although there is also a preview release of WinUI 3 with additional features, these aren’t supported in the production-ready version, so any code that uses any of these APIs won’t work with the production-ready release. That could be a little confusing, but it’s an approach that makes sense and one that you should expect Microsoft to take going forward, putting out production and preview releases at the same time.

Other aspects of Project Reunion that are ready for production include the new text-rendering tools and some of its resource management features. You can get started by downloading and installing the Project Reunion Visual Studio extension, which gives you templates for Project Reunion apps, and then using the NuGet packages for the available features in your code.

Microsoft did initially deprecate the popular Pivot control with this release, but there’s been a lot of developer feedback and it will return in a future release. Even so, Microsoft is strongly encouraging developers to start using the NavigationView control for new apps, with the Pivot control focused more on bringing existing code to the new platform.

There’s more to come

There’s a lot in the 0.5 release, but the project road map shows much more to come, both for packaged MSIX apps and for code using other installer technologies. The next major release will be 0.8, sometime in the second quarter of 2021. With Build likely to be in May, it’s a logical time for Microsoft to launch it. The 1.0 release will follow in the fourth quarter, likely to coincide with November’s .NET Conf.

These releases will add support for key Windows tools, starting with application life cycle functions, unifying the various ways of handling startup, restart, and managing multiple instances, as well as responding to the system power state. These are critical features for many classes of Windows applications, especially for taskbar and background apps. Support for power state can help you manage long-running applications, for example saving state when entering low-battery modes and supporting suspend during system sleep.

Microsoft intends these APIs to include support for file associations, allowing Project Reunion-enabled apps to launch when certain files are opened. This should make it more attractive for popular desktop applications, including Adobe’s Creative Cloud and Microsoft’s own Office.

It’s important to note that support for 0.5 is currently only available for desktop MSIX applications. Other packaging technologies, including Universal Windows Platform (UWP), remain in preview, with some not getting even that level of access until future releases. However, everything that’s in scope of 1.0 should be supported by release. The plan is to have multiple releases a year from 2022 on. A rapid release cadence should help Project Reunion catch up (and eventually overtake) the more mature existing Windows APIs and allow it to become the main route for your code to work with Windows in the near future.

Microsoft isn’t the only company offering support for Project Reunion 0.5. With WinUI 3 a key component in this release, control vendors such as Infragistics and Progress Telerik have suites of controls ready for use, while the open source Windows Community Toolkit is working on an update that adds support for Project Reunion. Cross-platform developers will be able to use it with the Uno Platform, as part of Uno 3.6’s C# and XAML tooling.

With a major milestone now reached, it’s clear that Microsoft is making significant progress with Project Reunion. With more features due in the next major milestone sometime in the next quarter, it looks like the project should deliver a release in 2021. The teams’ quick response to user feedback around the Pivot control shows that it’s listening to its users, a good sign for a platform that’s intended to deliver what users have been asking for. For now, start coding. More will be along very soon.

simon_bisson
Contributor

Author of InfoWorld's Enterprise Microsoft blog, Simon BIsson prefers to think of "career" as a verb rather than a noun, having worked in academic and telecoms research, as well as having been the CTO of a startup, running the technical side of UK Online (the first national ISP with content as well as connections), before moving into consultancy and technology strategy. He’s built plenty of large-scale web applications, designed architectures for multi-terabyte online image stores, implemented B2B information hubs, and come up with next generation mobile network architectures and knowledge management solutions. In between doing all that, he’s been a freelance journalist since the early days of the web and writes about everything from enterprise architecture down to gadgets.

More from this author