c# – What .NET 7 version can I use with Xcode 14.2?


I’m trying to build a .NET/C# app on MacOS. My dev tools are:

  • MacOS 12.7.2
  • Xcode 14.2
  • Visual Studio for Mac 17.6.7
  • The following NET 7 SDKs: 7.0.100, 7.0.311

I’ve also added the following global.json file in the root of my Solution, in order to control the used framework:

{
  "sdk": {
    "version": "7.0.100",
    "rollForward": "disable",
    "allowPrerelease": false
  }
}

My Project file contains:

<TargetFramework>net7.0-ios</TargetFramework>
<SupportedOSPlatformVersion>14.0</SupportedOSPlatformVersion>

If I build the C# project, I get the following error:

This version of Microsoft.iOS requires the iOS 16.4 SDK (shipped with
Xcode 14.3). Either upgrade Xcode to get the required header files or
set the managed linker behaviour to Link Framework SDKs Only (to try
to avoid the new APIs).

Being on Monterey, I am not able to install Xcode 14.3. Also setting the linker to “Link Framework SDKs Only” does not solve.

I’m assuming the choosen .NET version “7.0.100” is not compatible with my setup. If so, what .NET 7 framework version should I target in order to be able to build in my environment?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img