Skip to content

.NET 9 release notes

Rolf Bjarne Kvinge edited this page Mar 5, 2024 · 6 revisions

Warning This document is still work-in-progress/incomplete.

We're excited to announce our .NET 9 SDK release!

Note: these are the base SDKs that add support for the platforms in question, if you are looking for .NET MAUI (which is built on top of our SDKs), go here instead: https://docs.microsoft.com/en-us/dotnet/maui/.

Getting Started | What's New | Known Issues | Feedback | FAQ

Versions

This release consists of the following versions:

Requirements

It's highly recommended to use Xcode 16.0+ (which requires macOS 14.? (Sonoma)). Earlier versions of Xcode may work, but some features won't be available.

With the release the minimum supported OS versions can be targeted for apps:

  • iOS: 12.2 (to be confirmed)
  • macOS: 11 (to be confirmed)
  • tvOS: 12.2 (to be confirmed)
  • Mac Catalyst: 13.1 (to be confirmed)

Note: while we support macOS 11, we're only testing on OS versions that Apple supports. At the time of this writing this means we're only testing on macOS 12+.

Getting started

In contrast to how Xamarin.iOS and Xamarin.Mac were shipped (as installable *.pkg files), our .NET SDKs are shipped as workloads in the .NET world. This means that the first step is to getting started is to install .NET 9.0.100 (or later).

Then install the workload corresponding with the desired platform:

$ dotnet workload install ios # other workloads: macos, tvos, and maccatalyst

Create new app from a template with:

$ dotnet new ios # 'dotnet new --list --tag Mobile' will show all available templates

Finally build and run the new app in the simulator

$ dotnet run

What's New in this Release

This release contains SDKs for the following four platforms: iOS, tvOS, Mac Catalyst and macOS, and has support and bindings for the OS versions that were shipped with Xcode 16.0:

  • iOS 18.0
  • macOS 15.0
  • tvOS 18.0
  • Mac Catalyst 18.0

What's Changed

Xcode 16

We've added support for Xcode 16 + many new APIs in iOS 18, tvOS 18, macOS 15 and Mac Catalyst 18.

Type registrar: managed-static as the new default

In .NET 8 we introduced a new type registrar: managed-static primarily for supporting NativeAOT runtime. Due to the performance benefits that it brings, in .NET 9 we are enabling managed-static to be the new default registrar for all supported runtimes affecting the following configurations:

  • iOS and tvOS device builds in all configurations
  • macOS and MacCatalyst builds in release configuration

NOTE: simulator builds are not affected

Opting-out

Even though the new registrar is typically faster, it can also negatively impact the application size. Based on preliminary testing the size regression of a template MAUI iOS application with Mono varies between 2-3%.

For customers, for whom application size is critical, it is possible to opt-out from using the new default by adding the following MSBuild target to your project file:

<Target Name="SelectStaticRegistrar" AfterTargets="SelectRegistrar">
    <PropertyGroup Condition="'$(Registrar)' == 'managed-static'">
        <Registrar>static</Registrar>
    </PropertyGroup>
</Target>

...

New Contributors

Changelog

Full changelog

Breaking Changes

Unsupported TargetPlatformVersion is now an error instead of being ignored.

We support a few TargetPlatformVersion values (the optional OS version at the end of the TargetFramework - for instance for net9.0-ios18.0 the TargetPlatformVersion would be 18.0), but in the past we've ignored any unsupported values, and just fallen back to the latest supported version.

In .NET 9 using an unsupported TargetPlatformVersion will become an error instead. While the error message will list the valid versions, typically it's best to not put a version at all, and then we'll automatically pick the latest (and it won't be necessary to update in the future).

Known Issues

See Known issues in .NET 9.

FAQ

Feedback

File issues here: https://github.com/xamarin/xamarin-macios/issues/new.

Clone this wiki locally