Skip to content

Choosing a Toolchain

Justin Wojciechowski edited this page Nov 30, 2026 · 11 revisions

Choosing .NET and Xcode

Swift Bindings 11.0.0 works with .NET 10 on Xcode 26 or Xcode 27, and with .NET 11 on Xcode 27. No particular Xcode minor version is required. What has to line up is the .NET SDK, its Apple workload set, and the Xcode that workload set was built for. You do not need .NET 11 to use this release. A binding project and the apps that consume it can stay on .NET 10 for as long as you need.

This page covers how to pick a pairing, how to hold a machine (and a CI job) on it, and what changes if you later move to .NET 11. For how the versions you build with reach the people who consume your binding, see Platform Compatibility.

Supported pairings

Pairing .NET SDK Workload set Xcode iOS / tvOS / Mac Catalyst runtime macOS runtime
.NET 10 + Xcode 26 10.0.107 10.0.107 26.3 Mono (JIT on the simulator and Catalyst, full AOT on device), or NativeAOT when you publish with PublishAot CoreCLR
.NET 10 + Xcode 27 10.0.404 10.0.404 27.2 Same as above CoreCLR
.NET 11 + Xcode 27 11.0.100 11.0.100.1 27.2 CoreCLR: the interpreter in Debug, ReadyToRun in Release; or NativeAOT when you publish with PublishAot CoreCLR

The SDK, workload set, and Xcode columns show the versions this release was built and tested with. Other versions work too. A pairing is defined by the Apple workload set, not by the .NET SDK or the Xcode version alone: each Apple workload is built for one Xcode release and expects that Xcode. Microsoft's .NET for iOS release notes list the Xcode each release needs. To use an Xcode that isn't in the table, see Using another Xcode version.

.NET 11 with Xcode 26 is not a pairing: the .NET 11 Apple workloads are built for Xcode 27 (currently 27.2).

How long Xcode 26 stays supported. Swift Bindings keeps supporting the Xcode 26 pairing until Apple stops accepting new iOS app builds made with Xcode 26. Apple usually makes that change around April, so the planned end of support is roughly April 2027. The exact date follows Apple's announcement.

What decides each version

Four separate choices are involved. Each is made in a different place.

Choice Decided by Where you set it
.NET SDK The dotnet host picks the newest installed SDK, unless a global.json in the project's directory (or a parent) pins one global.json → sdk.version
Apple workload set The workload set installed for that SDK band dotnet workload install … --version, or global.json → sdk.workloadVersion
Xcode The active developer directory xcode-select -s, or the DEVELOPER_DIR environment variable for one shell or CI job
Target framework The <TargetFramework> in the binding project and in the app The .csproj

Which Apple SDK the binding is generated against

The binding is generated and its Swift wrapper is compiled with the active Xcode: the generator reads xcodebuild -version and runs swiftc and the SDK path through xcrun, which follow xcode-select or DEVELOPER_DIR. Binding a third-party .xcframework on Xcode 27.2 compiles its wrapper against the iOS 27.2 SDK. Binding an Apple framework (--appleFramework) reads that framework's API from the active Xcode's SDK, so Xcode 27.2 sees the iOS 27 API surface.

The platform version in the target framework (the 26.0 in net10.0-ios26.0) is a separate thing. It is what the binding package is labelled with, and it decides which apps can restore it. It comes from the .NET workload, not from Xcode:

Binding project's TFM .NET 10 + Xcode 26 .NET 10 + Xcode 27 .NET 11 + Xcode 27
net10.0-ios (versionless, the template default) packs as net10.0-ios26.0 packs as net10.0-ios26.0 not recommended, see below
net11.0-ios (versionless) — — packs as net11.0-ios27.2

On .NET 10 a versionless library resolves to the 26.0 platform on every workload, so a binding built with any Xcode 26 or 27 release on .NET 10 carries the same net10.0-ios26.0 label. On .NET 11 the Apple workloads build only the 27.2 platform. Other platform versions fail restore there with NETSDK1140, so a versionless net11.0-<platform> always means 27.2.

A Swift-only binding is labelled by the workload and compiled by Xcode. It can therefore be compiled against the iOS 27.2 SDK and still carry the 26.0 label. That works because the label decides restore compatibility, not which OS APIs exist. The deployment floor is set separately (see Platform Compatibility).

A versionless net10.0 third-party library binding packed on .NET 10 with Xcode 27 works in a .NET 10 app on Xcode 26, because the wrapper compiled by the newer Xcode keeps the binding's deployment floor. The reverse also works. A .NET 10 app on Xcode 27 can use a package packed on Xcode 26, and the build emits a SWIFTBIND139 message.

An Apple framework binding can't be shared across Xcode versions this way. Its API comes from the active Xcode's SDK, so packing one with a versionless TFM on Xcode 27.2 fails with SWIFTBIND137. Pack it with 27.2 TFMs instead. Packages built with 27.2 TFMs restore only in apps whose workload includes the 27.2 platform.

Using another Xcode version (for example 26.5)

You don't need the exact Xcode from the table. Swift Bindings checks only the Xcode major version, so any Xcode 26 or 27 release is accepted. The version that has to match is the one the .NET Apple workload was built for. To use Xcode 26.5 with .NET 10, for example:

  1. Install Xcode 26.5 and select it with sudo xcode-select -s /Applications/Xcode-26.5.app, or with DEVELOPER_DIR for one shell or CI job.
  2. Install the .NET workload set released for Xcode 26.5, and pin it with workloadVersion in global.json, as in the steps below. The .NET for iOS release notes name the Xcode each release needs.
  3. Keep the binding project and the apps on versionless TFMs (net10.0-ios). The binding still packs as net10.0-ios26.0.
  4. Clean bin/ and obj/ (see below).

Notes:

  • Which Xcode generates the binding. The generator and the Swift Bindings SDK use the active Xcode from xcode-select (shown by xcode-select -p) or DEVELOPER_DIR when set. The .NET workload also checks MD_APPLE_SDK_ROOT and your IDE's Apple SDK location setting ahead of xcode-select. If you point the workload at an Xcode that way, select the same Xcode with xcode-select -s or DEVELOPER_DIR too, or the binding will be generated with a different Xcode than the one building the app.
  • E0191. An app build fails with E0191 (This version of .NET for iOS (…) requires Xcode …) when the selected Xcode's major.minor version differs from the one the workload was built for. Install the workload set built for your Xcode, or select the Xcode the workload expects. You can skip Microsoft's check with ValidateXcodeVersion=false, though the workload will then use an Xcode version it wasn't built for.
  • Prebuilt Apple framework packages. These work here too. A .NET 10 app on Xcode 26.5 restores the 26.0 copy. See Apple Frameworks.

Staying on .NET 10 with Xcode 26

This is the pairing from earlier releases, and nothing about it changes in 11.0.0. The steps use Xcode 26.3 and the workload set built for it. With another Xcode 26 release, use that release's workload set.

  1. Install Xcode and select it:

    sudo xcode-select -s /Applications/Xcode-26.3.app
    xcodebuild -version        # should print Xcode 26.3

    Or select it for one shell or CI job only: export DEVELOPER_DIR=/Applications/Xcode-26.3.app/Contents/Developer.

  2. Pin the SDK and workload set with a global.json at the root of your repository, beside the solution. It applies to the binding projects and to the apps under it:

    {
      "sdk": {
        "version": "10.0.107",
        "rollForward": "latestPatch",
        "workloadVersion": "10.0.107"
      }
    }

    workloadVersion is the line that matters most. Without it, dotnet workload install or update takes the newest workload set for the SDK band. The newest .NET 10 workload sets need Xcode 27.1 or 27.2, so an unpinned machine can quietly move off Xcode 26.

  3. Install the workloads from that directory, so the pin applies:

    dotnet workload install ios macos maccatalyst tvos
    dotnet workload --info          # check the workload set version

    Until the install has run, dotnet workload --info reports Workload version 10.0.107, which was specified in …/global.json, was not found. Afterwards it reports Workload version: 10.0.107.

  4. Create or keep the binding project on net10.0. The template's default is net10.0, so nothing changes for a new project:

    dotnet new swift-binding -n MyLibrary.Swift.iOS
    <Project Sdk="SwiftBindings.Sdk/11.0.0">
      <PropertyGroup>
        <TargetFramework>net10.0-ios</TargetFramework>
      </PropertyGroup>
    </Project>
  5. Keep apps on a versionless net10.0-<platform> TFM, so the workload builds them against the platform version that its own Xcode supports. An app pinned to an older platform version selects that older platform pack, which expects the Xcode it was built for. For example, net10.0-ios26.0 fails on both .NET 10 pairings with This version of .NET for iOS (26.0.11017) requires Xcode 26.0. Set the app's <SupportedOSPlatformVersion> to at least the bindings' floor (15.0 on iOS). The .NET 10.0.107 dotnet new ios template writes 13.0, which warns SWIFTBIND011.

One thing to know about this pairing: no patched .NET 10 runtime pairs with Xcode 26.x. The runtime fix for GHSA-p3jp-9v83-76w9 (runtime 10.0.14 or later) first ships in workload sets that need Xcode 27.1 or later. A NativeAOT publish on this pairing therefore restores an affected Microsoft package, and NuGet reports NU1903, which fails the build under TreatWarningsAsErrors. The advisory concerns Microsoft's runtime, not Swift Bindings. Whether to accept the warning or move to Xcode 27.2 is your call. If you accept it, suppress only that advisory:

<ItemGroup>
  <NuGetAuditSuppress Include="https://github.com/advisories/GHSA-p3jp-9v83-76w9" />
</ItemGroup>

Staying on .NET 10 with Xcode 27

Use this pairing when you need the iOS 27 SDK, for example to bind a framework that requires it, but want to stay on .NET 10. The steps use Xcode 27.2 and the workload set built for it.

  1. Install Xcode and select it (sudo xcode-select -s /Applications/Xcode-27.2.app, or export DEVELOPER_DIR=/Applications/Xcode-27.2.app/Contents/Developer).

  2. Pin the SDK and workload set:

    {
      "sdk": {
        "version": "10.0.404",
        "rollForward": "latestPatch",
        "workloadVersion": "10.0.404"
      }
    }
  3. Install the workloads (dotnet workload install ios macos maccatalyst tvos) from that directory.

  4. Keep the binding project on net10.0-<platform>, exactly as on Xcode 26. It still packs as net10.0-<platform>26.0.

  5. Apps stay on a versionless net10.0-<platform> TFM, which this workload builds against the 27.2 platform.

Differences from Xcode 26:

  • iOS and Mac Catalyst apps need a scene manifest. The Xcode 27.2 workloads (both .NET 10 and .NET 11) fail an iOS or Mac Catalyst app whose Info.plist has no UIApplicationSceneManifest, with MT7199. This comes from the workload, not from Swift Bindings. Add a scene manifest to the app. A new app from this workload's dotnet new ios template already has one.
  • Binding an Apple framework yourself. A versionless net10.0-ios library compiles against the 26.0 reference assemblies, while the framework's API is read from the iOS 27.2 SDK. Use a versioned net10.0-ios27.2 TFM for an Apple-framework binding on this pairing, which is what the release gates do. The 26.2 platform version used on Xcode 26.3 isn't installed by this workload and fails restore with NETSDK1140. A package labelled net10.0-ios27.2 can only be restored by apps on a workload that has the 27.2 platform. See Apple Frameworks.
  • NativeAOT. The earlier .NET 10 / Xcode 27.0 and 27.1 workloads hit an upstream trimming regression (IL2037 on explicit interface properties of NSObject subclasses) during NativeAOT publish. The 27.2 workload (10.0.404) does not: the release gates publish and run the NativeAOT and Mono AOT device suites on this pairing. This pairing also restores a patched .NET runtime, so a NativeAOT publish has no NU1903 warning.

Moving to .NET 11

  1. Install the .NET 11 SDK, its workloads, and the Xcode release they are built for (currently Xcode 27.2). The versions are in the table above.

  2. Create the binding project with the template's --framework option:

    dotnet new swift-binding -n MyLibrary.Swift.iOS --framework net11.0
    dotnet new swift-binding -n MyFramework --appleFramework WeatherKit --framework net11.0

    For an existing project, change the TFM to net11.0-<platform>. The rest of the project stays as it is:

    <TargetFramework>net11.0-ios</TargetFramework>
  3. Apps use a net11.0-<platform> TFM as well. There is no Swift Bindings property to set for .NET 11.

What is different on .NET 11:

  • iOS, tvOS, and Mac Catalyst run on CoreCLR. A Debug build runs on the CoreCLR interpreter. A Release build is precompiled with ReadyToRun, and the interpreter still runs whatever ReadyToRun leaves to it. Both configurations are supported on the simulator and on device, though tvOS was tested only on the simulator, not on an Apple TV. macOS was already CoreCLR. NativeAOT is still available on device by publishing with PublishAot (see NativeAOT Deployment).
  • Mono is not available. UseMonoRuntime=true on a .NET 11 Apple app is rejected by the workload (NETSDK1242), and Swift Bindings reports SWIFTBIND125. The Mono-specific settings from earlier releases, such as the Mac Catalyst x64 interpreter default, apply to .NET 10 apps only.
  • Higher minimum OS on two platforms. The .NET 11 workloads require macOS 14 and Mac Catalyst 17. A binding generated for net11.0-macos declares a deployment floor of 14.0, and one for net11.0-maccatalyst declares 17.0. iOS and tvOS stay at 15.0.
  • A few members may refuse on the interpreter. Swift Bindings routes a binding's Swift-convention calls through native bridges that the interpreter can run. A member whose call can't be routed that way throws SwiftTransitionUnsupportedException (a PlatformNotSupportedException) on Mono and on the CoreCLR interpreter, before any native code runs, and works unchanged on NativeAOT. The build lists those members as SWIFTBIND130 warnings. The same guard applies to .NET 10 Mono apps.
  • Apps check the bindings they reference. A .NET 11 iOS, tvOS or Mac Catalyst app (Debug or Release, but not a NativeAOT publish) and a .NET 10 Mono app run a check on every referenced binding. A binding that carries Swift calls those engines can mishandle, without the evidence a current SDK records, fails the app build with SWIFTBIND132. Regenerate the binding with 11.0.0, or update the package. See Troubleshooting.
  • Your binding's audience changes. A binding project on net11.0-* packs as net11.0-<platform>27.2, which .NET 10 apps cannot restore (NU1202 for a package reference, NU1201 for a project reference). If you publish a binding for others, consider who is still on .NET 10 before you move it, or publish one package with a copy for each pairing (see Publishing — One package for every toolchain).

A .NET 11 app can reference a net10.0 binding package: NuGet accepts it, and the app runs it on CoreCLR in Debug (interpreter) and Release (ReadyToRun). A binding packed with 11.0.0 is checked when the app builds. A package built with an earlier release, including the SwiftBindings.Apple.* 26.2.x packages, carries no transition evidence and brings SwiftBindings.Runtime 0.20.x, so the app builds without that check. Its Swift-convention members are not guarded against the interpreter. If you publish one net10.0 binding for both audiences, pack it with 11.0.0.

Keep .NET 11 out of a .NET 10 build

Installing the .NET 11 SDK on a machine changes what dotnet picks by default: without a global.json, every project builds with the newest SDK and its workload set. The .NET 11 iOS workload carries one .NET 10 platform pack, net10.0_26.0, which requires Xcode 26.0. So a .NET 10 app in a directory with no global.json stops building on any Xcode other than 26.0, with This version of .NET for iOS (26.0.11017) requires Xcode 26.0. A .NET 10 binding project builds without any error, but on the .NET 11 SDK and that pack rather than the workload set you chose. If you have .NET 11 installed for one project and want another to stay on .NET 10:

  • Put a global.json with version and workloadVersion (as above) at the root of every .NET 10 repository.
  • Check what a directory resolves to with dotnet --version and dotnet workload --info.
  • In CI, select the Xcode per job with DEVELOPER_DIR rather than changing the machine-wide xcode-select setting, so jobs on different pairings don't affect each other.

The generator itself targets .NET 10 and is allowed to roll forward to a newer major runtime, so it runs on a machine that has only .NET 11 installed. You don't need .NET 10 installed to build a .NET 11 binding.

After switching Xcode or .NET, clean bin/ and obj/

Delete bin/ and obj/ in the binding project and in each app after you change the selected Xcode, the .NET SDK, the workload set, or the target framework:

rm -rf bin obj

The generated bindings, the compiled Swift wrapper and the restore output under obj/ belong to the toolchain that produced them. On iOS, tvOS and Mac Catalyst the SDK notices a change of Xcode and regenerates on its own, but a macOS binding and the app's own incremental build do not. If an app was already installed on a simulator or device, uninstall it before installing the rebuilt one: an incremental install can keep files from the previous toolchain.

Related

Clone this wiki locally