static void

ASP.Net Core

ASP.Net Core 1 (previously Asp.Net 5/MVC6) released June 2016.

Source code

NB: Core is intended for servers (incl. Asp and consoles), not for clients (so no Winforms/WPF) or old webforms.

dotnet tooling/SDK

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

Core runtime/ VS Tooling version (SDK)
1.0 / VS2015 Update 3 1.0.0-preview2-003121
1.1.0 / VS2017 RC4 1.0.0-rc4-004771
1.1.0 / VS2017 1.0.0

Project-specific tooling: global.json

{
  "projects": [ "src""test" ],
  "sdk": {
    "version""1.0.0-preview2-003121"
  }
}

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>netstandard1.4</TargetFramework>
  </PropertyGroup>
</Project>

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

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

Asp.net Core websites can also target full framework (note the sdk for web is Microsoft.NET.Sdk.Web; otherwise it's Microsoft.NET.Sdk)

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net461</TargetFramework>
    <RuntimeIdentifier>win7-x86</RuntimeIdentifier>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="1.0.3" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.2" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.1" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.1" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
  </ItemGroup>
</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.6.1 net461 (or net46) 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