Home > Enterprise >  Why is Visual Studio telling me that netstandard2.1 is incompatible with netcoreapp2.1?
Why is Visual Studio telling me that netstandard2.1 is incompatible with netcoreapp2.1?

Time:02-03

I have an old netcoreapp2.1 targeted project that cannot be upgraded. I am developing a (somewhat universal) class library for it and some other projects to use and I have published it to Azure DevOps private artifact storage.

According to MSDN, .NET Standard 2.1 should support .NET Core 2.1: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0

However, as soon as I attempt to add my library to my .NET Core 2.1 project, Visual Studio says:

Error   NU1202  Package My.Contracts 0.0.1.117 is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1). Package My.Contracts 0.0.1.117 supports: netstandard2.1 (.NETStandard,Version=v2.1)

I tried Visual Studio 2019 and 2022 - the same results. What's going on? Is MSDN lying or am I doing something wrong?

CodePudding user response:

This information seems to be wrong. The page .NET Standard versions says that .NET Standard 2.1 is supported since .NET Core 3.0

  •  Tags:  
  • Related