Core: Question: explicit runtime to 2.1.1 and got Microsoft.NETCore.Targets downgrade from 2.1.0 to 2.0.0

Created on 22 Jun 2018  Â·  2Comments  Â·  Source: dotnet/core

Could someone provide advise that is it need to specify the runtime version to 2.1.1
<RuntimeFrameworkVersion>2.1.1</RuntimeFrameworkVersion>

After we upgrade to AspNetCore App 2.1.1 from 2.1.0 everything look good.
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />

When I explicit specify runtime version 2.1.1, and see the Microsoft.NETCore.Targets downgrade to 2.0.0 from 2.1.0
<TargetFramework>netcoreapp2.1</TargetFramework> <RuntimeFrameworkVersion>2.1.1</RuntimeFrameworkVersion>

We can check the dependency changes on nuget.org
.NETCoreApp 2.1
https://www.nuget.org/packages/Microsoft.NETCore.App/2.1.0 => Microsoft.NETCore.Targets (>= 2.1.0)
https://www.nuget.org/packages/Microsoft.NETCore.App/2.1.1 => Microsoft.NETCore.Targets (>= 2.0.0)

Reference to .NET Core 2.1.1 https://github.com/dotnet/core/issues/1719

Thank you!

Most helpful comment

There shouldn't be any need to specify any runtime framework versions, or versions of the asp.net core shared framework.
When a patch update is installed on a server / machine that you run on, 2.1.1 will be used automatically. The tooling will choose appropriate NuGet package versions to use during the build. This may not need to be patch update versions since the app will use the newest patch versions of the runtime available on the machine (roll-forward behavior).

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    …
  </PropertyGroup>
  <ItemGroup>
     <!--  No Version needed -->
    <PackageReference Include="Microsoft.AspNetCore.App" />
    …
  </ItemGroup>
</Project>

All 2 comments

There shouldn't be any need to specify any runtime framework versions, or versions of the asp.net core shared framework.
When a patch update is installed on a server / machine that you run on, 2.1.1 will be used automatically. The tooling will choose appropriate NuGet package versions to use during the build. This may not need to be patch update versions since the app will use the newest patch versions of the runtime available on the machine (roll-forward behavior).

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    …
  </PropertyGroup>
  <ItemGroup>
     <!--  No Version needed -->
    <PackageReference Include="Microsoft.AspNetCore.App" />
    …
  </ItemGroup>
</Project>

Thank you @dasMulli !

Was this page helpful?
0 / 5 - 0 ratings