NETSDK1045 🟪 .NET

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

  1. Install the matching SDK
  2. Update or remove global.json’s version
  3. Set the SDK version in CI (actions/setup-dotnet)

Detailed fix by platform

Shell

  1. csharp
    dotnet --list-sdks
    cat global.json

YAML

  1. csharp
    - uses: actions/setup-dotnet@v4
      with: { dotnet-version: '8.0.x' }

How to diagnose

  1. SDKs — dotnet --list-sdks
  2. Pin — global.json
  3. 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:

🧠 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.