VS 2017 references old versions even after installing Latest SDK
I was using .Net Core 2.1.1 untill now, 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 and Microsoft.NETCore.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 (v2.1.3) from NuGet despite that i have 2.1.3 already installed on my machine.
I've tried specifying the version in the .csproj file, but again it downloads from the NuGet.
I am using VS 15.7.4 on Win 10 x64. And i have following .Net Core SDKs installed on my machine : 1.1.0 , 2.0.0 , 2.1.201 , 2.1.301 , 2.1.302 , 2.1.401.
We control sdk-version by having a global.json in the root of our solution.
{
"sdk": {
"version": "2.1.401"
}
}
We are on Linux and Mac (vscode), but I guess this should work when you are using Visual Studio as well.
@uffebjorklund Sorry i couldn't find global.json anywhere in my project.
I tried using RuntimeFrameworkVersion in the .csproj file. But it only updates Microsoft.NETCore.App to 2.1.3. Adding version tag to the package reference makes Nuget to download the package from the Nuget server.
There is no global.json by default.. just add one and then copy paste the content from my first post
I have also faced this issue. This is irrespective of VS 2017. I am not sure why NuGetFallbackFolder\ folder has the older version. When you issue dotnet --info command, it displays the current version.
I have also checked this after deleting the NuGetFallbackFolder. Once it's deleted, this is folder get again created at the time of dotnet new from somewhere (but don't know from where).
Issue moved to dotnet/cli #9933 via ZenHub