Announcing the first-ever true .NET Single Project for Mobile, Web, Desktop, and Embedded apps

Plus enhanced Skia renderers, Multi-Window, .NET 9 Preview support, and even more!

We are proud to announce the .NET ecosystem’s first and only true Single Project solution, empowering developers with a unified approach across all 9 platform targets, spanning mobile, web, desktop, and embedded apps. This genuine Single Project approach simplifies development, accelerates build times, and facilitates platform-specific development, enhancing your productivity and efficiency.

In addition, the 5.2 release also adds:

Enhanced Skia renderers for greater performance benefits and simplicity
• Our highly requested multi-window support
• Improvements to Uno.SDK by introducing Uno.SDK Features
.NET 9 Preview support

This release is our biggest yet, with a record-breaking 2400+ commits—900 more than our last. It was a massive team effort, and we can’t wait for you to experience the improvements and enjoy a smoother, more productive development workflow.

Let’s unpack the release and the amazing developer experience and productivity benefits it brings to .NET developers.

Watch the Uno Platform 5.2 Webinar

True Single Project for Nine Platform Targets across Mobile, Web, Desktop, and Embedded

The Single Project approach makes creating cross-platform .NET applications with Uno Platform simple, fast and flexible.

Simple – All platform targets in a Single Project for easy development and maintenance

The 5.2 release updates the project template, now unifying all platform targets—iOS, Android, Windows App SDK, Mac Catalyst, WebAssembly, Skia/Windows, Skia/Linux/X11, Skia/Linux/Framebuffer, and Skia/macOS— into a true Single Project.

You’ve voiced the need for a simpler start-up process for projects and a more manageable approach to handling NuGet packages and dependencies. These changes simplify the setup of new projects and streamline the maintenance and upgrade paths for existing ones. By consolidating multiple targets into one project template, we’ve reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or “shared” projects.

The resulting solution is easy to understand and maintain, as there are fewer knobs and configurations to turn to get to a functional app.

Here’s what the project structure looks like in Visual Studio before and after 5.2 release:

You’ll notice two new target frameworks, net8.0-browserwasm for WebAssembly and net8.0-desktop for Skia Desktop, as well as WinAppSDK in the same project. This makes the consistency of development between projects similar, without having to change the startup project.

We also would also like to thank @havendv who pioneered this feature, with a base on which we were able to build upon to integrate fully into all Uno Platform’s supported environments.

Fast – Speed up build times by up to 3 times

Using this single template structure, when compared to the previous template, the build time is effectively reduced by up to 3 times by only having the debugged target being built. No more tricks needed to filter active target frameworks! Using our Simple Calculator sample, building for Skia Desktop now takes 4 seconds where it used to take 9 seconds in previous releases.

Flexible – Write platform-specific code easily

Uno Platform has traditionally provided ways to create platform-specific C# and XAML, in case you need to access platform-specific native APIs and 3rd-party libraries, or because you’d like your app to look and behave differently depending on the platform.

With the introduction of the two new target frameworks (net8.0-desktop and net8.0-browserwasm explained above) we are providing you the ability to specialize code in the app’s code for Skia Desktop and WebAssembly in the same project.

We are also adding the ability to use platform specific code in an Uno Platform class library, in a very clean and elegant way.

Using this feature, it’s possible to write code that will be executed only on specific platforms:

				
					#if HAS_UNO
Console.WriteLine("Uno Platform - Pixel-perfect apps that run everywhere");
#else
Console.WriteLine("Windows - Built with Microsoft's own tooling");
#endif

#if __ANDROID__
Console.WriteLine("Android only code with net8.0-android");
#elif __IOS__
Console.WriteLine("iOS Only Code with net8.0-ios ");
#elif __WASM__
Console.WriteLine("WebAssembly Only Code with net8.0-browserwasm ");
#elif HAS_UNO_SKIA
Console.WriteLine("Skia Desktop Only Code with net8.0-desktop ");
#endif


				
			

It is also possible to do XAML conditional code:

				
					<StackPanel Margin="20,70,0,0">
  <TextBlock Text="This text will be large on Windows, and pink on WASM"
       win:FontSize="24"
       wasm:Foreground="DeepPink"
       TextWrapping="Wrap"/>
  <TextBlock android:Text="This version will be used on Android"
       not_android:Text="This version will be used on every other platform" />
  <ios:TextBlock Text="This TextBlock will only be created on iOS" />
 </StackPanel>

				
			

You can view all the available C# compile-time constants and XAML conditional namespaces in our docs.

Introducing Uno.SDK Features for easy NuGet package management

As Uno Platform grows, so does the number of NuGet packages available to developers, depending the features being used in an app. To reduce the confusion around packages used all around the projects, Uno Platform 5.2 introduces implicit packages in a very similar fashion to ASP.NET. All common NuGet package references are now provided automatically by the Uno.Sdk.

It is then only needed to specify which Uno Platform features are used by the app, and their versions by package groups such as Uno.Extensions, themes, toolkit and alike.

Here’s an example on how to specify Uno Platform features, in the main project file:

				
					<PropertyGroup>
    <UnoFeatures>
      Material;
      Hosting;
      Toolkit;
      Logging;
      MVUX;
      Configuration;
      Http;
      Serialization;
      Localization;
      Navigation;
      ThemeService;
    </UnoFeatures>
</PropertyGroup>

				
			

This declaration creates very small projects files, with very little plumbing to understand to create an app. This also makes upgrading easier, as the versions are provided in one place in the Directory.Build.props file:

				
					<PropertyGroup>
    <UnoExtensionsVersion>4.1.14</UnoExtensionsVersion>
    <UnoToolkitVersion>6.0.18</UnoToolkitVersion>
    <UnoThemesVersion>5.0.13</UnoThemesVersion>
    <UnoCSharpMarkupVersion>5.2.13</UnoCSharpMarkupVersion>
  </PropertyGroup>

				
			

It is also important to note that since 5.1, upgrading the Uno Platform version is done through the global.json file, this way:

				
					{
  // To update the version of Uno please update the version of the Uno.Sdk here.
  // See https://aka.platform.uno/upgrade-uno-packages for more information.
  "msbuild-sdks": {
    "Uno.Sdk": "5.2.80"
  }
}

				
			

Debugging with Single Project

On the debugging side, the Single Project unifies the experience. All launch profiles (the top part of the list below) and target frameworks are available in one place in Visual Studio:

It is now easier to switch between target platforms without having to change the Startup Project which makes for a seamless user experience for you as a developer.

In practice, when selecting a launch profile, Uno Platform will automatically select the appropriate target framework. Conversely, selecting a target framework will automatically choose a compatible launch profile. As Android and iOS have their own automatic profiles, you can use the net8.0-android and iOS targets to start debugging.

VS Code works in a similar fashion, where all available targets are presented for you to choose from.

Enhanced Skia renderers for improved performance

The new support for the Single Project also brought the ability to merge all desktop Skia-based targets in the new “desktop” target framework. This allows for suppressing all the deployment subtleties around having a project head per platform and provides a single output package that can automatically use the right backend for the current running platform.

It can be configured using this new desktop builder:

				
					 var host = SkiaHostBuilder.Create()
            .App(() => new App())
            .UseX11()
            .UseLinuxFrameBuffer()
            .UseMacOS()
            .UseWindows()
            .Build();
host.Run();

				
			

Under the hood, Uno Platform will automatically select the proper backend. If you are keen to understand what’s happening, when running on:

  • Windows, the WPF backend is used,
  • Linux, the new X11 backend is used when X11 is available, otherwise the Linux Framebuffer backend is used,
  • macOS, the new AppKit backend with Metal is used

The advantages of these new X11 and macOS targets are that Gtk+3 has been removed, making it faster to start and easier to install. This removes about 200MB of binaries from Gtk+3 on Windows or macOS.

Also, note that we are retiring the Gtk head support from the project template. It has served well all those years, however in some scenarios it had been causing performance, package size, installation, and rendering reliability issues. While the Gtk version will be available as part of Uno Platform releases for the time being, but no new features will be added.

Visit our docs for help migrating from older GTK projects to new project structures.

Skia TextBox for performance and consistency

This new release introduces a new default TextBox implementation for our Skia targets that is entirely rendered using Skia primitives, providing a consistent and performant experience across desktop platforms.

While previous releases of Uno Platform were using a native overlay (WPF/Gtk native controls) for the TextBox control, the new implementation is using the Composition API and Harfbuzz primitives to render a more accurate and integrated experience. This includes key features such as keyboard interactions, selection highlighting, single and multi-line input, copy/paste, undo/redo, and theming support. This new approach also enables support for Linux framebuffer, which cannot provide a “native” control, and was also a critical feature to get our new desktop X11 and macOS targets for the new Single Project template.

Note that if your project is using the WPF head project, the `desktop` target framework on Windows or the Gtk head, you can still roll back to the native control behavior by using the `Uno.UI.FeatureConfiguration.TextBox.UseOverlayOnSkia` feature configuration property.

Multi-Window support

In version 5.2, Uno Platform adds an eagerly awaited capability for desktop apps: the ability to show secondary windows! This paves the way for crafting even more versatile applications.

Sticking true to our commitment, we’ve aligned closely with the WinUI API surface to facilitate seamless creation of new windows. You can either initiate a blank new window using the Microsoft.UI.Xaml.Window type directly or go further by designing a custom window type, which inherits from Window, with XAML and code-behind included.

For those looking to push the boundaries, the Window.AppWindow property is your gateway to advanced customization. It grants the power to assign custom presenters, enabling you to transform your window into a full-screen experience or to tweak its position and dimensions to suit your needs.

This release lays groundwork for multi-window applications across Windows, macOS, and Linux platforms. Keep an eye out for upcoming updates, as we’re working hard to extend this multi-window support to mobile platforms shortly!

				
					var window = new Window();
window.Content = new TextBlock() { "I'm second window!" }
window.Activate();
				
			

IDE availability

Starting immediately the new Single Project is available for Visual Studio and VS Code users. At this time, JetBrains Rider users can use iOS, Android Catalyst and WinAppSDK targets, but the net8.0-browserwasm and net8.0-desktop target frameworks are not yet recognized by Rider. In the meantime, it’s possible to continue using the Uno Platform 5.1 templates `dotnet new` templates that are compatible with Rider in order to do WebAssembly and desktop apps

Uno packages NuGet signature

As of Uno 5.2, the Uno Platform NuGet packages are using a new code signing certificate, and if you were relying on signature validation, make sure to add our new certificate to your toolchain.

Improved Getting Started Wizard UX

Based on your feedback, we have simplified the New Project Wizard Template experience. In addition to better streamlining the project creation process, in the “Framework” tab you can already chose .NET 9 Preview. If you’re on Linux or macOS, make sure to use our Live Wizard to create your project!

.NET 9 Preview support

If you’ve been following us then you know that we generally stay in lockstep with all .NET previews so that we are compatible on the day it RTMs.  In this spirit, a new option in the Getting Started Wizard and dotnet new templates has been added to enable the creation of .NET 9 Preview apps, using the latest Preview 3 from the .NET team.

To start using .NET 9, our Uno.Check tool supports .NET 9 with the `–pre-major` command line parameter, then use our Visual Studio Wizard to create a new project using .NET 9.

If you’re having issues or comments with .NET 9 Preview 3 support, make sure to open a discussion on our repo so we have a great launch on when .NET 9 RTMs by the end of the year.

Community shout Out

Several community members contributed PRs to this release:

  • Documentation updates by @mcNets, @gevart and @SimonCropp
  • A Gtk update for background window color by @lindexi
  • A Geometry render fix for Skia targets by @lindexi
  • The ability to access android Intent for android pickers by @jp-weber
  • Updates for SystemFocusVisual positioning by @TopProgrammer77
  • Performance updates by @SimonCropp

That said, a special shout out goes to users: HavenDV, biozal and naweed for providing very strong feedback and rationale about the Single Project direction, which made us move this item up on our priority list. Thank you!

Next Steps

Uno Platform 5.2 is here, and it’s a game-changer for .NET developer experience and productivity! But don’t just take our word for it—dive in and see for yourself. 

Uno Platform 5.2 LIVE Webinar – Today at 3 PM EST – Watch