4

I am trying to build this project in Visual Studio for Mac:

https://github.com/macNetCore/CodeBook/tree/master/Chapter5/configProgram

During compilation I receive a warning:

/usr/local/share/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp3.0' 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.

I decided to try and change the target framework in the project settings:

enter image description here

What I am finding is that when I select either:

  • .NET 5.0
  • .NET Core 3.1

And click OK and then re-display the options it has reverted to .NET Core 3.0.

In short, what steps must I take to to stop the build warning?


I have seen this question and I definitely have the correct SDK's installed. So I don't understand why clicking OK won't persist my choice for 3.1.

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164

1 Answers1

14

You can add

<CheckEolTargetFramework>false</CheckEolTargetFramework>

For an example:

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <CheckEolTargetFramework>false</CheckEolTargetFramework>
  </PropertyGroup>

Additionally you can refer to this post as well. https://andrewlock.net/fixing-build-warning-netsdk1138-when-building-end-of-life-projects-with-dotnet-5/

Ameer
  • 293
  • 3
  • 11