Edit

NETSDK1138: The target framework is out of support

NETSDK1138 is a warning that your project targets a version of .NET that is out of support. The warning message is similar to the following example:

The target framework '<framework>' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy.

The .NET 5 SDK introduced this check. Current SDKs set the MSBuild property CheckEolTargetFramework to true by default for executable projects. For class libraries, set the property to true explicitly to enable the warning. The SDK used to build the project determines which target frameworks trigger the warning.

To resolve the warning, change your project to target a supported version of .NET.

Tip

You can use GitHub Copilot modernization to assess, plan, and upgrade your project to a supported version of .NET.

If you want to suppress the message without targeting a later framework, set the MSBuild property CheckEolTargetFramework to false. You can set it in the project file or by passing /p:CheckEolTargetFramework=false to a .NET CLI command, such as dotnet build. Here's an example project file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <CheckEolTargetFramework>false</CheckEolTargetFramework>
  </PropertyGroup>
</Project>

Here's an example .NET CLI command:

dotnet build /p:CheckEolTargetFramework=false

See also