Enrico
Enrico

Reputation: 6256

.NET 8 on iMac doesn't install

Visual Studio 2022, Visual Studio for Mac and Visual Studio Code make me crazy when I have to deploy apps for iOS (and macOS). I have my .NET 8 MAUI application that is working on Windows and Android. I can deploy the application to an iPhone Simulator and a real device.

After the upgrade of Visual Studio on my Windows to the version 17.10.1, I can't build a release of the app to deploy it on a real device or create the package for the Apple Store.

So, I tried to build the application on Visual Studio for Mac or Visual Studio Code. In both cases I get this error

.NET 8.0 SDK is required to build this application, and is not installed. Install the latest update to the .NET 8.0 SDK by visiting https://aka.ms/vs/mac/install-netcore8

I installed I don't know how many times the .NET 8 package but there is no way to get this message out. So, I open again Visual Studio for Mac and I found that I have to enable the option for .NET 8 under Preview Features.

enter image description here

If I try to run the project, I get this error

error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 7.0 or lower, or use a version of the .NET SDK that supports .NET 8.0.

There are months I'm fighting with the creation of iOS apps. It is not very stable. One day is working, another is not. The only think I'm doing is changing the configuration between development and production.

Upvotes: 0

Views: 464

Answers (1)

Peter Davis
Peter Davis

Reputation: 46

I know this post is old, but if you are migrating from Xamarin to MAUI in Visual Studio (deprecated) you can do this:

  1. Update your Mac's operating system version (I have MacBook Pro, Sonoma 14.7)
  2. Update XCode and update iOS (today iOS 18.0)
  3. Update Visual Studio (today 17.6.14)
  4. Check in Visual Studio use .Net 8.0 in Preview Features
  5. Install SDK 8.0.403 and .NET Runtime 8.0.10 from https://dotnet.microsoft.com/en-us/download/dotnet/8.0 (today version, IMPORTANT: If you install and still have the error, install x64 and arm64, or restart mac)
  6. Open the terminal in Visual Studio (View - Terminal):
    • sudo dotnet workload install maui (press enter and wait installation)
    • sudo dotnet workload install maui-tizen (press enter and wait installation)
    • sudo dotnet workload install ios (press enter and wait installation)
  7. Close Visual Studio and open again
  8. Done

Upvotes: 1

Related Questions