Error NETSDK1045 The current .NET SDK does not support targeting .NET 11.0. Either target .NET 8.0 or lower

Wheelstring 150 Reputation points
2024-02-27T14:37:02.4866667+00:00

Hi all I migrated functional project Xamarin to maui via utility "upgrade-assistant upgrade" generated good πŸ‘. But when I run/compile it, I got:

Error NETSDK1045 The current .NET SDK does not support targeting .NET 11.0. Either target .NET 8.0 or lower, or use a version of the .NET SDK that supports .NET 11.0. Download the .NET SDK from https://aka.ms/dotnet/download in file: \Microsoft.NET.TargetFrameworkInference.targets 166

if I change value <TargetFrameworkVersion>v12.0</TargetFrameworkVersion> in file .Android.csproj.user I got:

Error NETSDK1045 The current .NET SDK does not support targeting .NET 12.0. Either target .NET 8.0...

What should I setup please? Thanks and best regards!

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,231 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 51,346 Reputation points
    2024-02-27T17:35:20.4466667+00:00

    NET 8 is the latest LTS release and NET 9, which has just started development, is the latest CTS. There is no NET 11/12 release to target. Not sure why your target framework was set to this value.

    Irrelevant this is the old property for NET Framework apps. Your MAUI app shouldn't even have that property. Remove the TargetFrameworkVersion property and replace it with <TargetFrameorks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>. This targets Android, iOS and Mac for NET 8. Alternatively create a new MAUI project temporarily and copy the TargetFrameworks properties from the project file as there are several that you might need, one is conditional.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful