4
votes

I was using .Net Core 2.1.1, and recently updated the SDK to 2.1.401 (.Net Core Runtime 2.1.3). When i create a new project the version of Microsoft.AspNetCore.App under Dependencies > SDK is still 2.1.1. Looking at the properties of Dependencies > NuGet, the package is being referenced from "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.app\2.1.1"

I tried installing Package 2.1.3 using NuGet package manager, and it downloaded all dependencies from NuGet despite that i have 2.1.3 already installed on my machine.

How do i force existing / new project to use the latest version of packages from the SDK install ?

2
You are correct! I have checked this! same to me. May be this is a bug. Please report it here: github.com/aspnet/Home/issuesTanvirArjel
Thanks for your suggestion, fyi .. here's the link to the issue that i've raised : github.com/dotnet/core/issues/1895Praveen Rai

2 Answers

1
votes

You shouldn't need to update the version of Microsoft.AspNetCore.App manually in your project. 2.1.1 is perfectly fine. Your application will run on the latest 2.1.* framework installed on the machine.

If you publish a self-contained application, the tooling will automatically switch to the latest known version of 2.1.* at build time for the self-contained build only. (-r win-x64 argument)

This may or may not change for the 2.2 or 3.0 releases, read/follow this GitHub issue and thread for more information.

0
votes

This is a bug as it has already been reported but for now this can be the solution.

In ProjectName.csproj file:

<PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeFrameworkVersion>2.1.3</RuntimeFrameworkVersion>
</PropertyGroup>

<ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.3" />
</ItemGroup>