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
The installed .NET SDK is older than the project’s TargetFramework.
Seen on:
.NET
Meaning
global.json pinning an old SDK, CI images with old SDKs, or Visual Studio versions bundling older SDKs cause this.
Common causes
- SDK not installed for the target framework
- global.json pins an older SDK
- CI image/setup-dotnet using an old version
- Old Visual Studio/MSBuild
⚡ Quick fix
- Install the matching SDK
- Update or remove global.json’s version
- Set the SDK version in CI (actions/setup-dotnet)
Detailed fix by platform
Shell
- csharp
dotnet --list-sdks cat global.json
YAML
- csharp
- uses: actions/setup-dotnet@v4 with: { dotnet-version: '8.0.x' }
How to diagnose
- SDKs — dotnet --list-sdks
- Pin — global.json
- CI — Configured version
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- COPY failed COPY failed: file not found in build context / "/app/x": not found
- DefaultAzureCredential failed DefaultAzureCredential failed to retrieve a token from the included credentials / ManagedIdentityCredential authentication unavailable
- did not complete successfully failed to solve: process "/bin/sh -c ..." did not complete successfully: exit code: 1
Most viewed in .NET
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026