37

I have some class library projects in targets netstandard2.1.

When I referenced that to my WPF project in target .NET Framework v4.8, On building time I get an error:

Severity Code Description Project File Line Suppression State Error Project '..\ClassLibrary1\ClassLibrary1.csproj' targets 'netstandard2.1'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.8'. WpfApp1

What can I do?

Update: I read this Q/A about referencing netcoreapp2.1 and in that answer telling about add netstandar2.1. But my libraries are already in targets netstandard2.1!

Behzad
  • 3,502
  • 4
  • 36
  • 63

2 Answers2

25

What can I do?

  1. If your library doesn't need the very latest features, use .net standard 2.0
    in general, a library should aim to support the lowest possible version.

or

  1. port your WPF app to .NET Core 3 or later
Behzad
  • 3,502
  • 4
  • 36
  • 63
H H
  • 263,252
  • 30
  • 330
  • 514
19

Here is the latest compatibility documentation for .NET Standard versions.

.NET Framework will not support .NET Standard 2.1 or any other later version. For more details, see this blog post.

Ishmaeel
  • 14,138
  • 9
  • 71
  • 83
Behzad
  • 3,502
  • 4
  • 36
  • 63