Hello Jeff,
Since .NET 8 for MAUI is out of support as of May 2025, upgrading to .NET 9 is the correct path forward.
Fortunately, you do not need to upgrade Xcode immediately. The .NET 9 SDK provides workload sets that allow you to pin the MAUI workload version to one that is compatible with your existing Xcode 16.4 installation.
First, create a global.json file in the root directory of your solution.
{
"sdk": {
"version": "9.0.306",
"workloadVersion": "9.0.305"
}
}
This configuration specifies that while you are using a .NET 9.0.3xx SDK, the workloads for MAUI should be from the 9.0.305 set, which maintains compatibility with Xcode 16.4.
Next, you need to update your project's .csproj file to target .NET 9. It is important to use the <TargetFrameworks> (plural) property to maintain support for all your target platforms (iOS, Android, etc.).
<PropertyGroup>
<!-- This ensures your application continues to target multiple platforms -->
<TargetFrameworks>net9.0-ios;net9.0-android;net9.0-maccatalyst</TargetFrameworks>
<!-- This line conditionally adds the Windows target when building on a Windows machine -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<!-- Other existing project properties -->
<OutputType>Exe</OutputType>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
</PropertyGroup>
After making these changes, remember to clean your environment to avoid any conflicts with previously installed workloads.
From your solution's root directory, run the following commands:
# Clear all local NuGet package caches
dotnet nuget locals all --clear
# It is also recommended to manually delete all 'bin', 'obj' and '.vs' folders
# within your solution to ensure a completely clean build.
With the environment cleaned and global.json in place, you can now install the correct MAUI workloads.
# This will install the MAUI workloads specified by the 'workloadVersion' in your global.json
dotnet workload install maui
# Verify that the workloads were installed correctly
dotnet workload list
The output of dotnet workload list should now show the MAUI workloads installed from the 9.0.305 workload set.
If you continue to experience the iossimulator-x64 error, the dotnet workload repair command can be used to fix any issues with the workload installation itself.
dotnet workload repair
After completing these steps, try building your project again.
I hope this helps. If the problem persists, please provide details about what have you tried and any error messages you are seeing.
Thank you.