Yesterday I updated from .NET 7.0 to .NET 8.0 following my colleague doing so and having it work immediately. For myself however, on both my VS Mac and my VS Windows I get the error

Error NETSDK1139: The target platform identifier ios was not recognized.

enter image description here

(This error also appears in the android variant if set to ios as the deploy target)

The target frameworks are listed as net8.0-android;net8.0-ios;

enter image description here

I've all of the following~

  • Uninstalling all .NET SDKs and Workloads, as well as VS 2022
  • Reinstalling only VS 2022 and .NET 8 (.NET 6 and 7 being automatically installed with VS)
  • Running command line statements such as dotnet workload restore and install for maui, maui-ios and maui-android.
  • A brand new Maui project
  • I've also attempted to get maui-check working but it seems entirely busted at the moment with errors such as 'zsh: killed maui-check'.

It's also worth noting that~

  • When creating a new maui project .NET 8 is not an option, only .NETs 7 and 6
  • I don't have any simulators or devices appearing as deploy targets since updating.

enter image description here

  • My .NET core and runtimes are listed both in VS 2022 and when running command lines to check which are installed on the system.

enter image description here

I would really appreciate anyone's knowledge on this subject and especially anyone who has previously encountered and dealt with this.

3

There are 3 best solutions below

3
FreakyAli On BEST ANSWER

I had the same issue and the following is what fixed it,

  • Make sure you have the preview feature on your Mac

enter image description here

1
piotr5 On

There is not enough information to provide you just right details to fix but these things I would check first:

  • Do you have latest version of VS?

  • Do you have other versions of VS?

  • Check if you have other workloads.

Check open issues with similar problem. Like there was an issue reported some time ago on github - https://github.com/dotnet/maui/issues/1795

0
Ben Butzer On

I had this NETSDK1139 problem with my command line build script, and realized I needed to switch from msbuild to dotnet build. I was able to build the app otherwise in Visual Studio 2022 IDE, but not with msbuild. The vstool had replaced mdtool with Visual Studio 2017. A switch to msbuild to replace vstool was necessary with Visual Studio 2022. Now finally dotnet.