KB PS NETSDK1045 Incompatible NET SDK Version - rpapub/WatchfulAnvil GitHub Wiki

Problem: NETSDK1045 – Incompatible .NET SDK Version

Symptoms

Error Message

German:

Fehler NETSDK1045 Das aktuelle .NET SDK unterstützt .NET 8.0 nicht als Ziel. Geben Sie entweder .NET 7.0 oder niedriger als Ziel an, oder verwenden Sie eine .NET SDK-Version, die .NET 8.0 unterstützt.

English Translation:

Error NETSDK1045 The current .NET SDK does not support targeting .NET 8.0. Either target .NET 7.0 or lower, or use a .NET SDK version that supports .NET 8.0.

Root Cause

The project targets .NET 8.0, but the installed SDK only supports .NET 7.0.

Solution

  1. Check Installed .NET SDKs Run the following in PowerShell:

    dotnet --list-sdks
    

    If .NET 8.0 is missing, proceed with installation.

  2. Install .NET SDK 8.0

  3. Restart Visual Studio and verify the fix by rebuilding the project.

References