If you upgrade Visual Studio to the latest version and want to upgrade your .NET Core project to the new Standard definition, you might experience missing “.NET Standard” entries in your project’s properties. All entries contain the Core framework, not Standard.

E.g. if you develop a class library which you want to be maximum compatible (even with .NET Framework 4.6.1 upwards), it makes more sense to target it to .NET Standard instead of Core.

In most cases, this can be fixed quickly:

  1. Edit [yourproject].csproj (right click on project in Solution Explorer)
  2. One of the first few lines should look like  <TargetFramework>netcoreapp1.1</TargetFramework> or <TargetFramework>netcoreapp2.0</TargetFramework>.
  3. Replace it with:

     

Save the .csproj file, your project should compile like before the change.

If you open your project properties again, the dropdown box should now contain .NET Standard entries.

 

Note: If you use self-contained deployment (SCD) and want to publish an .exe file (e.g. for target win10-x64), .NET Standard does only produce a DLL, e.g. with this command:

Using the same command with “netcoreapp2.0” in target framework instead of “netstandard2.0”, we will get an .exe file.

Share This:

  [email protected]