Join our Discord server for community support and discussions Icon description

Uno Platform 5.5 – Automated App Packaging, .NET 9 RC2, OpenGL, WebView2 and more

Each release, we don’t just improve—we aim to revolutionize your development experience. For this release, we focused on drastically reducing the time and complexity required to package and distribute your cross-platform applications, in addition to a plethora of other productivity and performance features.  

Our new App Packaging automates the process of bundling binaries, assets and dependencies into platform-specific installers for Linux, macOS and Windows on desktop. And, yes, that’s in addition to the seamless support we already provide for Mobile and Web packaging. It saves hours of frustration and eliminates dozens of manual steps typically required to prepare your app for publishing—all with just a few commands or clicks.  

In addition to app packaging improvements, we are adding support for .NET 9 RC2 with WebAssembly, OpenGL Support, WebView2, New Skia Canvas, Combo Box and Templated Parent.

It’s a big release, grab a coffee and let’s dissect it topic-by-topic.   

App Packaging

Traditionally, regardless of the tech stack you are using, app packaging is one of the most dreaded tasks developers face when getting an app to end-users.

While in the past we supported easy store packages creations for iOS, Android, Catalyst and WebAssembly, we’re now introducing packaging improvements for Windows (ClickOnce), Linux (Snap) and macOS (.app) for our desktop targets. 

With our new packaging feature, you will be able to generate executables quickly, allowing for easy installation across various operating systems, or getting the package to be store-ready with just a few commands or clicks.

The changes are included in the “dotnet publish” command, which allow for generating platform specific packages suitable for installing on different operating systems. 

Here’s a dependency graph of the packaging features: 

We’re planning to add support for more package types on various operating systems, such as dmg, pkg or flatpack.

Generating packages

To generate a snap package of an uno app, you can run the following command from a Linux shell: 

				
					dotnet publish -f net8.0-desktop -p:SelfContained=true -p:PackageFormat=snap 
				
			

This will generate a snap package that you can install with the following command, or publish on the snap store: 

				
					sudo snap install myunoapp_1.0_amd64.snap --dangerous --classic
				
			

Similarly, you can generate a “.app” package on macOS with the following command: 

				
					dotnet publish -f net8.0-desktop -r osx-arm64 -p:SelfContained=true -p:PackageFormat=app 
				
			

You can then take the generated “.app” folder and drag it to the “Applications” folder. 

This whole process takes just a few minutes! You can find more information about publishing desktop apps in our docs. 

.NET 9 RC2 for WebAssembly

With .NET 9, we’re now integrating directly with its SDK and workloads, eliminating the need for separate installs like Python, Emscripten, or ninja-build. Now, developers only need the .NET SDK and workloads to build WASM apps. 

Previously, we built our own .NET WebAssembly runtime, but Microsoft’s SDK and runtime now surpass what we needed, making it logical to use and contribute to this industry-standard approach. 

The Uno.Wasm.Bootstrap package now serves as an integration layer on top of the .NET WebAssembly SDK, removing our custom runtime. It seamlessly interacts with JavaScript and MSBuild APIs, supporting PWAs, Hot Reload, and memory profiling, letting users enjoy ongoing .NET Runtime improvements and fixes. 

New features enabled via .NET Runtime support

Among the SDK features that are now available as part of .NET 9: 

  • Incremental Builds support, particularly when AOT is involved. 
  • Satellite assemblies, time zone and ICU partial downloads, giving the ability for localized binaries to be fetched for relevant browser cultures
  • WebCIL, used to reduce the impacts of antiviruses blocking files 
  • Individual assemblies cache breaker, used to ensure resources are not downloaded unnecessarily when unchanged. 
  • Browser application caching for assemblies, used to initialize apps faster and avoid using the HTTP cache 
  • CIL Strip after AOT, used to remove code from assemblies that has been AOT compiled 
  • Jiterpreter updates to improve the Wasm interpreter and AOT modes performance 
  • AOT builds can now be created on macOS arm64, Windows arm64 and Linux arm64 
  • Python and emscripten are now automatically managed by the .NET SDK, and ninja-build is not needed anymore
  • Improved debugging support, as the whole tooling chain provided by .NET, making it natively compatible with VS and VS Code. 

Among the other benefits of moving to .NET 9 official workloads, Uno Platform becomes very easy to migrate to use the upcoming alpha builds of .NET 10. This is going to be particularly important for Threading support that is likely to arrive in the .NET 10 timeframe. 

Note: The 5.5 update only addresses WebAssembly support for .NET 9, as our mobile and desktop support for .NET 9 release candidates has already been baked in since the Uno Platform 5.3 release. 

New Uno Platform 5.5 specific features

Uno Platform also provides these additional features: 

  • C# Hot Reload is now fully supported in VS 2022, including metadata update handlers to get the best reload experience.
  • Profiled AOT continues to be an easily accessible feature through the Uno.Wasm.Bootstrap package 
  • The Log Profiler, which is a memory profiling feature we originally introduced in our previous versions of the runtime. This profiler was not included in the .NET 8 official SDKs, and we worked with the .NET team to integrate fully in .NET 9. 
  • Full cache breaking, including app assets, which allows for applications to publish new versions and avoid cross-contamination between revisions of the same app while browsers caches are taking time to expire. This feature is baked in the core publishing of Uno Platform, you do not need to take action to enable it. 

Threading

When it comes to threading, Microsoft’s runtime team has made major changes to how threads interact with the DOM and JavaScript, aiming to improve stability.

Since threading was, and continues to be an experimental feature, these changes now prevent managed code from running on the main JavaScript thread — something Uno Platform depends on.

As a result, WebAssembly threading is currently not supported in Uno Platform apps. However, as Microsoft’s runtime team is working on it, we hope that the support for threading may return in future .NET 10 preview builds. 

Upgrading to .NET 9 for WebAssembly

Additionally, .NET has improved its runtime performance, bringing down by half the startup time for an already cached app. For example, the loading time with our .NET 9-updated Uno Calculator and Uno Playground went down by a significant margin.  

To upgrade to .NET 9 and the new bootstrapper, two paths are available: 

  • If you’re using the Uno.SDK, you only need to upgrade your target frameworks to `net9.0`, and you’ll be automatically the new features. 
  • If you’re not using the Uno.SDK, you’ll need to change the top level SDK from “Microsoft.Net.Sdk.Web” to “Microsoft.Net.Sdk.WebAssembly”.

     

In all cases, you’ll now need to install the “wasm-tools” .NET workloads:

				
					dotnet workload install wasm-tools 
				
			

You can get more details about upgrading to .NET 9 in our documentation. 

Benchmarks in .NET 9 for WebAssembly

.NET 9, combining all the options enabled, brings interesting size improvements ranging from 7% to 56% depending on compilation modes. 

Comparing with previous .NET 8 and uno.wasm.bootstrap, when running a blank template: 

  Queries  Uncompressed size (MB)  Compressed size (MB) 
net8 + interpreter  77  26.7  8.4 
net9 + intepreter  82  24.8  6.6 (-27%) 
net8 + Profiled AOT  77  34.2  10.2 
net9 + Profiled AOT  82  31.9  9.5 (-7%) 
net8 + AOT  77  83.1  20.2 
net9 + AOT  82  77.8  12.9 (-56%) 

WebView2 for WebAssembly – the first in XAML World!

We are excited to bring WebView2 control support to WebAssembly, making our solution the only cross-platform XAML framework to offer this functionality.   It allows you to display basic external or local web content within your WebAssembly Uno Platform application.

The control is natively based on an iframe, which means it adheres to the browser security restrictions. For instance, the external site must not use X-FRAME-OPTIONS to prevent embedding. If you are in control of the target site, you can use the frame-ancestors Content Security Policy to specify your app’s URL to allow embedding it in this manner, while keeping the ability disallowed for other sources.

OpenGL Canvas – Long Awaited and Client Co-funded!

With this release, we’re introducing the support for hardware accelerated rendering OpenGL 3D content directly in Skia Desktop targets for Linux, Windows and macOS, as well as Windows App SDK. The new GLCanvasElement control allows natively embedding 3D graphics sections in your 2D app. 

This new control is using Silk.NET to provide the managed APIs to interact with OpenGL. This control also automatically handles the setup and lifecycle of the 3D rendering context in a unified 2D Skia environment, across all desktop platforms. You only need to draw your content! 

This is a great example of our enterprise support program as this pretty big feature has been co-financed with a client. Our sincerest thanks go to our (anonymous) client as we can now offer OpenGL to the entire Uno Platform community!!

On the technical side, for Windows and Linux, OpenGL is used directly and on macOS, Metal is used through the ANGLE library: 

You can find a sample on how to use the GLCanvasElement in our Uno.Samples repository, as well as read our docs. 

New Skia Canvas

To significantly improve the performance of Skia-based user code, we’re introducing the new SKCanvasElement control that integrates directly with the Uno Platform Skia Desktop rendering pipeline to use hardware acceleration. 

For instance, you can draw content similar to samples fiddle.skia.org can provide: 

Currently, when using SKXamlCanvas from SkiaSharp, the Skia content is rendered using software rendering, then copied onto a hardware accelerated surface. 

With this new Control, the Skia canvas that the Uno Platform renderer uses is provided to developers, giving the ability to render content at the same speed as Uno Platform does, using all the features SkiaSharp provides. 

Here’s an example of code which uses SkiaSharp directly: 

				
					#if HAS_UNO_SKIA // This control is only available on netX.0-desktop 
public class MyCanvas : SKCanvasElement 
{ 
    protected override void RenderOverride(SKCanvas canvas, Size area) 
    { 
        var minDim = Math.Min(area.Width, area.Height); 
        // rescale to fit the given area, assuming each drawing is 260x260
        canvas.Scale((float)(minDim / 260), (float)(minDim / 260)); 

        // https://fiddle.skia.org/c/@shapes 
        var paint = new SKPaint(); 
        paint.Style = SKPaintStyle.Fill;
        paint.IsAntialias = true; 
        paint.StrokeWidth = 4;
        paint.Color = new SKColor(0xff4285F4); 

        var rect = SKRect.Create(10, 10, 100, 160); 
        canvas.DrawRect(rect, paint); 

        var oval = new SKPath(); 
        oval.AddRoundRect(rect, 20, 20); 
        oval.Offset(new SKPoint(40, 80)); 
        paint.Color = new SKColor(0xffDB4437); 
        canvas.DrawPath(oval, paint); 

        paint.Color = new SKColor(0xff0F9D58); 
        canvas.DrawCircle(180, 50, 25, paint); 

        rect.Offset(80, 50); 
        paint.Color = new SKColor(0xffF4B400); 
        paint.Style = SKPaintStyle.Stroke; 
        canvas.DrawRoundRect(rect, 10, 10, paint); 
    } 
} 
#endif 
				
			

This control can be added as a child of any other Panel in your UI. 

We intend to make changes in SkiaSharp in order to use this new feature and improve the performance of the SKXamlCanvas rendering.

Editable ComboBox

ComboBox was supported by Uno Platform since the initial release, but its implementation was not aligned with the original source in WinUI. As a result, we lacked some significant features including support for IsEditable property, which allows the user to enter a custom value instead of just selecting a predefined item from the dropdown list. 

Also, while we had to custom code the best ComboBox based on our community and clients’ needs, this does not align with our vision of reusing existing WinUI controls whenever possible. It was time to change this and align with the original source!

The new ComboBox is a completely new port of WinUI ComboBox!  We ported over three thousand lines of code from WinUI, bringing in not only editability support, but also additional missing behaviors including keyboard input support, and focus handling. The changes even required improvements on the base Selector primitive! 

Finally, to make sure our behaviors match WinUI, we added around 40 integration tests, which are run across all our targets and ensure everything runs reliably. 

You can experiment with this new feature in the Uno Playground. 

TemplatedParent updates

In this release, we’re addressing a long-standing behavior difference with WinUI with TemplatedParent. 

In WinUI, TemplatedParent is an XAML-only concept that processed when a Control template is materialized from a XAML file. Specifically, if an element from a XAML-materialized control template is being removed, or a foreign element is added, the TemplatedParent value will not be updated. 

In Uno Platform, we initially implemented this feature as an inherited property back when the WinUI source was not publicly available. Our approach led to subtle differences in how TemplatedParent and TemplateBindings were processed, which required numerous small adjustments both within Uno Platform and in user applications to closely match the official WinUI behavior, which was not ideal and was preventing you from getting maximum productivity.  

Thanks to WinUI now being open source, with Uno Platform 5.5, we’re bringing this feature to parity with the official behavior, closing tens of related issues. In most cases, your app will not be affected by this change, but if you had included workarounds regarding Template bindings, those can be removed. 

Performance Improvements

Performance is a recurring theme at every release. We continued improving memory and runtime performance with this release: 

  • The TemplatedParent update deprecates and disables an implicitly inherited property, reducing the number of propagations and storage of values in the tree. 
  • Adjustments in the way DependencyObject stores, boxes, and initializes properties, reducing the memory consumption during value changes as well as during initialization. 


Those improvements are wide reaching, as they touch most controls and their properties. You may notice improved performance for larger applications.
 

Migrating to Uno Platform 5.5

Ready to upgrade to 5.5? Here’s what you need to know:

  • .NET 9 RC2 WebAssembly updates
  • New App Packaging automation
  • WebView2 and OpenGL support

Introducing My Account at Uno Platform website

Alongside our 5.5 release, our marketing team has been busy giving our website a serious upgrade! We’re aiming to bring you even more perks for staying connected with us and the Uno Platform community.

Create an account for seamless access to all our extensions—Visual Studio, Visual Studio Code, and Rider—through a single registration. You’ll also unlock early access to exciting new features and have a direct line for sharing feedback to help us improve. Looking to connect? Share your social profiles to easily network and engage with the Uno community!

We got something Hot cookin’!

If you’ve made it this far in the blog, you are a true Uno Platform fan. And we’ve built something unique to further help with your productivity. If you’d like to be one of the first to try it out, please sign up at Uno Platform Waitlist. 

Next Steps

We’ve got exciting projects ahead that we can’t wait to share. But for now, we can't wait to see what you'll build with Uno Platform.

Tags: XAML, WPF, Xamarin, UWP, Silverlight, .NET, Windows, C#, XAML

Related Posts

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