How do I target .NET Standard 2.0 in a freshly created .NET Core 2.0 web app?

Geesh_SO picture Geesh_SO · Oct 7, 2017 · Viewed 10.4k times · Source

I've just created a fresh project using dotnet new web. My Google-foo may be failing me, but I didn't find anything relating to my answer (please link to another SO answer, or relevant documentation if I've missed something obvious).

If I want to ensure this new project is .NET Standard 2.0 compliant, what do I now do?

Answer

Matt H picture Matt H · Oct 7, 2017

NET Standard is for class libraries. Applications must target netcoreapp* where * is a version number. The following shows the compatibility matrix: https://docs.microsoft.com/en-us/dotnet/standard/net-standard

For example, .NET Core 2 can consume .NET Standard version 2 and below.