Xamarin.iOS / Xamarin.Mac / Xamarin.tvOS β .NET Migration
For SDK-style project templates, MSBuild property tables, RuntimeIdentifier conversion tables, and namespace mappings, see references/ios-migration-api.md.
Migration Workflow
- Create new .NET for iOS/macOS/tvOS project (same name, copy code into it)
- Update MSBuild properties (see
references/ios-migration-api.md) - Move
MinimumOSVersionfrom Info.plist βSupportedOSPlatformVersionin csproj - Copy code, resources, storyboards, entitlements
- Update NuGet dependencies
- Migrate binding libraries (if applicable)
- Replace Xamarin.Essentials with
<UseMauiEssentials>true</UseMauiEssentials> - Remove
.dll.configfiles (not supported in .NET) - Delete
bin//obj/, build, verify code signing, test on device
Strategy: Create a new project and copy code into it β don't edit the existing project file.
Critical Gotchas
β οΈ No Backward Compatibility for iOS/Mac NuGet Packages
Unlike Android, there is no backward compatibility with old Xamarin iOS/Mac TFMs. Packages targeting monotouch, xamarinios, xamarinios10, monomac, or xamarinmac will not work β they must be recompiled for net8.0-ios etc.
β οΈ CodeSigningKey β CodesignKey Rename
<!-- β Old property name β silently ignored -->
<CodeSigningKey>Apple Distribution: My Company</CodeSigningKey>
<!-- β
Renamed property -->
<CodesignKey>Apple Distribution: My Company</CodesignKey>Also rename MtouchEnableSGenConc β EnableSGenConc.
β οΈ No .dll.config or .exe.config Support
.dll.config and <dllmap> are not supported in .NET Core. Migrate configuration to appsettings.json, embedded resources, or platform preferences.
β οΈ watchOS Is Not Supported
Xamarin.watchOS has no .NET equivalent. Bundle Swift extensions with .NET for iOS apps instead.
β οΈ OpenGL (iOS) Is Not Supported
OpenTK is unavailable in .NET for iOS. Migrate to Metal or SceneKit.
β οΈ Linker Behavior Is Stricter
Update LinkDescription XML files if custom linker configuration was used. The linker in .NET is stricter and may trim symbols that the Xamarin linker preserved.
Platform-Specific Pitfalls
| Pitfall | Impact | Mitigation |
|---|---|---|
| iOS/Mac NuGet packages not backward-compatible | Build failures for packages targeting xamarinios |
Recompile or find .NET-compatible alternatives |
CodeSigningKey silently ignored |
App fails to sign but no clear error | Rename to CodesignKey |
MtouchArch not converted |
Wrong architecture targeted | Convert to RuntimeIdentifier(s) β see reference tables |
MinimumOSVersion left in Info.plist |
Ignored β uses csproj value | Move to SupportedOSPlatformVersion |
| Entitlements path wrong | Build succeeds but runtime failures | Verify CodesignEntitlements points to correct file |
.dll.config files present |
Silently ignored at runtime | Remove and migrate to alternatives |
Binding Library Migration Tips
- Use SDK-style project format with
net8.0-iosTFM - The binding generator and API definitions work the same way
- Verify native frameworks are updated for the target iOS version
- Test thoroughly β binding edge cases are common in .NET migrations
NuGet Compatibility Decision
| Situation | Action |
|---|---|
| You own the package | Recompile with .NET TFMs |
| Package has preview .NET version | Use preview |
| No compatible version | Replace with .NET-compatible alternative |
| .NET Standard library (no platform deps) | β Still works |
Build Troubleshooting
| Issue | Fix |
|---|---|
| Namespace not found | Most UIKit namespaces are unchanged β verify against .NET for iOS API surface |
| Linker errors | Update LinkDescription XML files β linker is stricter in .NET |
| Code signing failure | Verify CodesignKey, CodesignProvision, CodesignEntitlements |
| Entitlements mismatch | Ensure entitlements file matches provisioning profile |
API Currency Warning
If your migrated app will also adopt .NET MAUI controls (e.g., via UseMaui), check the maui-current-apis skill for deprecated MAUI APIs to avoid (ListView, Frame, Device.*, etc.).
Quick Checklist
- β Created new .NET for iOS/macOS/tvOS project
- β Set
TargetFrameworktonet8.0-ios(or-macos/-tvos) - β Moved
MinimumOSVersionβSupportedOSPlatformVersionin csproj - β Converted
MtouchArchβRuntimeIdentifier(s) - β Converted
HttpClientHandlerβUseNativeHttpHandler - β Renamed
CodeSigningKeyβCodesignKey - β Renamed
MtouchEnableSGenConcβEnableSGenConc - β Copied source, resources, storyboards, entitlements
- β Updated NuGet dependencies (no backward compat with Xamarin TFMs!)
- β Added
UseMauiEssentials+Platform.Init()if using Essentials - β Removed
.dll.configfiles - β Deleted
bin/andobj/folders - β Verified code signing and provisioning
- β Tested on physical device