How to prevent End of Life warning when building for deprecated .Net versions

With increasingly rapid evolutions of Framework, it is sometimes desirable to remain, for some projects, with deprecated versions of .Net.

It must be a conscious decision of the risks but you must be able to say “I accepted this risk and I don’t want to be bothered by these warnings anymore”.

One solution is to set precisely the version number of the SDK used for that compilation by using a global.json file. Doing so ensure you also use same deprecated SDK.

But you could prefer to use a more recent SDK while building for an ancient target.

And without warning. That’s exactly what CheckEolTargetFramework permit us to do: it’s a MSBuild property that can be set to to false to prevent warning NETSDK1138.

More on this subject on Fixing build warning NETSSDK1138 when building projects with end-of-life .NET frameworks.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s