# 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

**Code:** `NETSDK1045` · **Category:** .NET · **Seen on:** .NET

The installed .NET SDK is older than the project’s TargetFramework.

## 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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/dotnet/netsdk1045-sdk-does-not-support-targeting)
