Skip to content

.NET release notes Xcode 13.3

Rolf Bjarne Kvinge edited this page May 16, 2022 · 11 revisions

[These notes are incomplete and still in progress]


We're excited to announce our first SDK release for .NET! After many years of work we've moved to .NET, where among other things we'll get an updated Base Class Library, which is unified across all .NET platforms.

Note: these are the base SDKs that add support for the platforms in question, for 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

Requirements

It's highly recommended to use Xcode 13.3 (which requires macOS 12.0 (Monterey)). Earlier versions of Xcode may work, but some featuers won't be available.

Minimum supported OS versions:

  • iOS: 10.0
  • macOS: 10.14
  • tvOS: 10.0
  • Mac Catalyst: 13.1

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 6.0.300 (or later).

Then install the workload corresponding with the desired platform:

$ dotnet workload install ios # other workloads: macos, tvos, or 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 13.3:

  • iOS 15.4
  • macOS 12.3
  • tvOS 15.4
  • Mac Catalyst 15.4

Everything.

  • Added support for arm64 in the iOS and tvOS simulator when running on an ARM64-capable Mac.
  • Added support for arm64 for macOS projects. Note that the default is to always build for x64, to build for arm64 set the runtime identifier to osx-arm64:
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>

Notable Changes

Removed OpenTK dependency

We've removed the dependency on OpenTK, a long-standing community request: https://github.com/xamarin/xamarin-macios/issues/13160

.NET linker / trimmer

.NET 6 ships with a linker which is shared between all platforms. This linker is very similar to the linker in Xamarin.iOS and Xamarin.Mac (it has the same origin), but since it's used by more platforms across Microsoft, it will be updated and improved much more.

For compatibility reasons most of the old linker modes continue to work as-is: LinkSdk, None and Full. There was a Platform mode for Xamarin.Mac, which is not supported anymore, Most of the old linker modes still work "Platform" mode is gone for macOS. "LinkSdk", "None" and "Full" are still available for all platforms. manual mode is also available.

macOS

The macOS SDK is using the CoreCLR runtime instead of the Mono runtime.

There are a few known incompatibilities between CoreCLR and Mono, those are listed here.

Mac Catalyst

We've added support for Mac Catalyst!

Conditional compilation symbols

We define both __IOS__ and __MACCATALYST__ for Mac Catalyst.

System version

The system version for Mac Catalyst (as returned by UIDevice.CurrentDevice.SystemVersion) is the macOS version.

However, the helper method UIDevice.CurrentDevice.CheckSystemVersion takes the corresponding iOS version (like the .NET availability API does).

Exception marshalling is enabled by default

We've enabled exception marshalling by default, because it prevents numerous potential problems (crashes, memory corruption, memory leaks, etc.)

However, there is a performance difference when calling into Objective-C code. In the future we'll make it possible to avoid this performance difference (at the cost of a slightly bigger app), but in the meantime it's possible to disable Objective-C exception marshalling by adding the following property to a PropertyGroup in your project file:

<MtouchExtraArgs>--marshal-objectivec-exceptions:disable</MtouchExtraArgs>

Release History

First release!

Breaking Changes

See Breaking Changes

Known Issues

See [Known issues in .NET](Known issues in .NET)

Feedback

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

API Changes / API Diff

Frequently Asked Questions

What will happen with the old-style Xamarin.iOS and Xamarin.Mac products?

We'll continue to ship Xamarin.iOS and Xamarin.Mac separately for a while, but they will eventually be discontinued.

Ref: <link to blog post? documentation?>

How to publish from the command line

This will create an *.ipa (for iOS and tvOS) or *.pkg (for macOS and Mac Catalyst) for publishing to the App Store:

$ dotnet publish

Clone this wiki locally