Azure Pipelines: "NETSDK1045: The current .NET SDK does not support targeting .NET 10.0"
Each .NET SDK can build for its own .NET version and every older one, not for a newer one. NETSDK1045 means the SDK that ran this build is older than the TargetFramework in the project file: an SDK 9 build of a net10.0 project, for example. On a pipeline agent several SDKs are often installed side by side, so the question is which one the build actually used, and why.
When the failing build is a pull request's build validation, the pull request waits on it: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, lists the pull request's branch policies with their state in Rider or IntelliJ IDEA, and with Pro runs a failed build policy again once the fix is pushed. Get it on JetBrains Marketplace
What it looks like
error NETSDK1045: The current .NET SDK does not support targeting .NET 10.0. Either target .NET 9.0 or lower, or use a version of the .NET SDK that supports .NET 10.0. Download the .NET SDK from https://aka.ms/dotnet/downloadThe first version is the project's target, the second the newest that this SDK can build.- To see which SDK the step used, put
dotnet --versionanddotnet --list-sdksin a script step just before the build. The first prints the SDK that the folder's global.json, if any, selects.
What the hosted images have
- The
ubuntu-24.04,windows-2022andwindows-2025images of November 1, 2026 have .NET SDKs 8, 9 and 10, the newest 10.0.403 (their readmes in the runner-images repository). Without a global.json,dotnetuses the highest installed SDK, sonet10.0builds there as is. - .NET 11 is not on the images: Microsoft's release index lists it as a release candidate today. To target
net11.0before the images have it, install it withUseDotNet@2andincludePreviewVersions: true. - The same index gives November 10, 2026 as the end of support for both .NET 8 and .NET 9, which is why many projects move to
net10.0now and meet this error in pipelines that were set up for an older SDK.
The usual causes in a pipeline
- A
UseDotNet@2step with an olderversion, such as8.x, left from when the project targeted .NET 8. The task installs into$(Agent.ToolsDirectory)/dotnetand puts that folder first on the PATH, so later steps use that SDK, not the newer ones of the image. Change the version to the project's (10.x), or remove the step. One SDK is enough for a solution with several targets: the newest builds all the older ones. - A global.json with an older
sdk.version. With a version and norollForwardthat allows a newer major,dotnetstays on that SDK's version line even when a newer one is installed. Update the version, or setrollForwardtolatestMajorif any newer SDK is fine. WithuseGlobalJson: true,UseDotNet@2installs what global.json asks for and follows itsrollForward. - A build with Visual Studio's MSBuild (
VSBuild@1orMSBuild@1). Microsoft's table of SDK and Visual Studio versions says targetingnet10.0is supported in Visual Studio 18.0 or later; the hosted Windows images have Visual Studio 2022, 17.14. The same page recommendsdotnet buildovermsbuildwhere possible, so build SDK-style projects withDotNetCoreCLI@2or adotnet buildscript. - A self-hosted agent with only the SDKs someone installed by hand. Add the SDK on the machine, or let
UseDotNet@2download it into the agent's tool folder.
- task: UseDotNet@2
inputs:
packageType: sdk
version: '10.x'
- script: dotnet --version
- task: DotNetCoreCLI@2
inputs:
command: build
projects: '**/*.csproj'
Azure DevOps pull requests in Rider and IntelliJ IDEA
Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. It shows the branch policies of a pull request with their state, so a required build that has not passed is next to its pull request, and with Pro you run a failed or expired build policy again from there. The review inbox is free; voting, commenting, completing and creating are Pro, with a 30-day trial.
Get it on JetBrains Marketplace
Azure DevOps, Azure Pipelines, .NET and Visual Studio are trademarks of Microsoft Corporation; Rider and IntelliJ IDEA are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.
More: Dotnet command failed with non-zero exit code · MSB3644: reference assemblies not found · Azure DevOps Server pull requests in Rider · 日本語