core icon indicating copy to clipboard operation
core copied to clipboard

VS 2017 references old versions even after installing Latest SDK

Open Praveen-Rai opened this issue 8 years ago • 6 comments

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.

Praveen-Rai avatar Aug 26 '18 16:08 Praveen-Rai

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 avatar Aug 27 '18 07:08 uffebjorklund

@uffebjorklund Sorry i couldn't find global.json anywhere in my project.

Praveen-Rai avatar Aug 27 '18 18:08 Praveen-Rai

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.

Praveen-Rai avatar Aug 27 '18 18:08 Praveen-Rai

There is no global.json by default.. just add one and then copy paste the content from my first post

uffebjorklund avatar Aug 27 '18 19:08 uffebjorklund

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).

noorrocks avatar Aug 30 '18 14:08 noorrocks

Issue moved to dotnet/cli #9933 via ZenHub

Petermarcu avatar Aug 31 '18 18:08 Petermarcu