static void

ASP.Net Core

Asp.Net 5/MVC6 (pre-release) Pre 2016 The command line tools were k (hence "Kestrel") and then dnx, before becoming "dotnet".
.Net Core 1.0 released June 2016 originally in Visual Studio 2015. Support ended in 2019.
.Net Core 1.1 released November 2016 Support ended in 2019.
.Net Core 2.0 released August 2017 Implemented .NetStandard 2.0 and lots more APIs. Project files changed from project.json/ .xproj to an updated .csproj xml formt. Support has ended (in October 2018)
.Net Core 2.1 released May 2018 Added Span<T>
.Net Core 3.0/3.1 released 2019 Supports more APIs including winforms. Support ends December 2022
net 5 released 2020 Drops "core" from name; there was no v4. C# 9 (record types, init setters). Supports ends 2022
net 6 released 2021 C# 10 (global usings, file-scoped namespace), minimal apis. breaking changes

Source code

dotnet tooling/SDK

The 2016/VS2015 tooling was preview; it is only RTM with VS2017.

Project-specific tooling: global.json

{
  "sdk": {
    "version""3.1.102",
    "rollForward""latestMinor"
  }
}

Project types

Projects have a <TargetFramework> (in full framework we had <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>).
NB: for multi-targeting, it's plural <TargetFrameworks> with a semicolon delimiter.

Netstandard class libraries can be called by "classic" framework .net as well as Core.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
  </PropertyGroup>
</Project>

Core class libraries can only be called from Core projects, not full framework.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
</Project>

For Asp.net Core websites the sdk for web is Microsoft.NET.Sdk.Web; otherwise it's Microsoft.NET.Sdk

.net core 2 could run on framework (TargetFramework net461 with RuntimeIdentifier of win7-x86) but since core 3 this is no longer possible.

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
</Project>

A console app just has an OutputType of "Exe"

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.0</TargetFramework>
  </PropertyGroup>
</Project>

Multi-targeting

Frameworks run .net code, and there can be several in the same project (multi-targeting). Note TargetFrameworks is plural!

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>netcoreapp1.0;net451</TargetFrameworks>
  </PropertyGroup>
</Project>

For references/packages add them with msbuild conditionals.

  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">
    <PackageReference Include="System.Data.Common" Version="4.1.0" />
    <PackageReference Include="System.Xml.XmlSerializer" Version="4.0.11" />
  </ItemGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System" />
    <Reference Include="Microsoft.CSharp" />
  </ItemGroup>

The framework moniker (.net 4.6 is "net46") is the same label used in Nuget packages. It's also available (uppercased to NET46) as a conditional compilation symbol when you build.

Framework Versions Framework (TFM) Dependency (MetaPackage)
Full framework 4.8 net48 N/A (installation)
NetStandard (API) 1.6 netstandard1.6 NETStandard.Library 1.6.0
.Net Core (June 2016) 1.0 netcoreapp1.0 Microsoft.NETCore.App 1.0.0
.Net Core (Nov 2016) 1.1 netcoreapp1.1 Microsoft.NETCore.App 1.1.0
.Net Core (Aug 2017) 2.0-3.1 netcoreapp2.0
netcoreapp3.1
No longer required

.Net Standard

.Net Core (1-2) can run on .Net full framework, or by itself. .Net Standard is a common API (in programming terms, an interface). Netstandard class libraries are binary compatible across the framework, core, Xamarin, UWP etc.

Each netstandard is a superset of the previous. Core 1.0 supports all netstandards from netstandard1.0 (net45) to netstandard1.6 (net461).

With .Net Core 3.0, there is no longer any support for the full framework.

Netstandard 2.1 is the highest (final) version; net5 and net6 are newer versions which are not compatible with .net framework (although netstandard can still be referenced).

.Net Standard .Net Framework .Net Core
netstandard1.6 net 4.6.1 (net461) Core 1.0 (netcoreapp1.0)
netstandard2.0 net 4.6.1 (net461) Core 2.0 (netcoreapp2.0)
netstandard2.1 - (Not supported!) Core 3.0