Skip to content

Instantly share code, notes, and snippets.

@Tornhoof
Created November 12, 2018 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tornhoof/d3be5feab24eba1d81e0a4911994a74e to your computer and use it in GitHub Desktop.
Save Tornhoof/d3be5feab24eba1d81e0a4911994a74e to your computer and use it in GitHub Desktop.
NetCoreApp version vs. Asp.NET Core App Version
.NET Core SDK (gemäß "global.json"):
 Version:   2.1.403
 Commit:    04e15494b6

Laufzeitumgebung:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.403\

Host (useful for support):
  Version: 2.1.5
  Commit:  290303f510

.NET Core SDKs installed:
  2.1.300 [C:\Program Files\dotnet\sdk]
  2.1.403 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Build via: dotnet publish -c Release -o ..\OutputAsp2.1.0 --self-contained

Following csproj -> empty WebApplication project with properties:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
    <!-- <RuntimeFrameworkVersion>2.1.0</RuntimeFrameworkVersion> -->
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
	<!-- <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0" /> -->
  </ItemGroup>

</Project>

Four combinations:

  1. Default, like above:
  ".NETCoreApp,Version=v2.1": {
      "WebApplication1/1.0.0": {
        "dependencies": {
          "Microsoft.AspNetCore.App": "2.1.5",
          "Microsoft.NETCore.App": "2.1.5"
        },
        "compile": {
          "WebApplication1.dll": {}
        }
      }
  1. Enable RuntimeFrameworkVersion
    ".NETCoreApp,Version=v2.1/win10-x64": {
      "WebApplication1/1.0.0": {
        "dependencies": {
          "Microsoft.AspNetCore.App": "2.1.5",
          "Microsoft.NETCore.App": "2.1.0"
        },
        "runtime": {
          "WebApplication1.dll": {}
        }
      }
  1. Enable RuntimeFrameworkVersion and ASP.NET Core App Version
    ".NETCoreApp,Version=v2.1": {
      "WebApplication1/1.0.0": {
        "dependencies": {
          "Microsoft.AspNetCore.App": "2.1.0",
          "Microsoft.NETCore.App": "2.1.0"
        },
        "compile": {
          "WebApplication1.dll": {}
        }
      }
  1. Enable only ASP.NET Core App Version
    ".NETCoreApp,Version=v2.1": {
      "WebApplication1/1.0.0": {
        "dependencies": {
          "Microsoft.AspNetCore.App": "2.1.0",
          "Microsoft.NETCore.App": "2.1.5"
        },
        "compile": {
          "WebApplication1.dll": {}
        }
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment