Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build
.gitattributes
.gitignore
Class1.cs
README.md
Terrajobst.Demos.Require472.csproj
Terrajobst.Demos.Require472.sln

README.md

Require .NET Framework 4.7.2

This shows how you can author a NuGet package that will provide an error message if the consumer is on .NET Framework 4.6.1 - 4.7.1.

Why? NuGet will allow .NET Standard 2.0 libraries to be referenced from .NET Framework 4.6.1 and higher. Unfortunately, there are issues1 with that which is why we recommend that consumers should be on .NET Framework 4.7.2 or higher.

1 See footnote 2 in the .NET Standard support table.

General Approach

The NuGet package injects a custom MSBuild target that checks the .NET Framework version and provides an error if it's in the problematic range.

You can’t perform that action at this time.