Project-system: For .Net Core 3.1, VS does not have 3.1 in the Target Fx dropdown of the properties pages.

Created on 27 Sep 2019  路  15Comments  路  Source: dotnet/project-system

Visual Studio Version: D16.4/29325.124.master(16.4.0 preview2.0)

Steps to Reproduce:

  1. Install .net core SDK 3.1.100-preview1-014070 against d16.4/29325.124.master

  2. Create a new .net core project via VS and open property pages, for "Application" tab, the "Target framework" is empty, there is no ".NET Core 3.1".
    image
    Note: Open the .csproj file, "netcoreapp3.1" is by default.

Expected Behavior:
3.1 templates should be available in Visual Studio

Actual Behavior:
VS does not have 3.1 in the Target Fx dropdown of the properties pages.

Dotnet --info:
.NET Core SDK (reflecting any global.json):
Version: 3.1.100-preview1-014070
Commit: 156f17d882

Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.100-preview1-014070\

Host (useful for support):
Version: 3.1.0-preview1.19470.9
Commit: 72b39b0473

.NET Core SDKs installed:
3.0.100 [C:\Program Files\dotnet\sdk]
3.1.100-preview1-014070 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0-preview1.19474.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0-preview1.19470.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.0-preview1.19470.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

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

Triage-Approved

Most helpful comment

I ran into this as well, I did have a global.json which limited it, then restarted VS and can see it now. This probably needs UI in Visual Studio along the lines of 'Targets are limited to 3.0.1 by current global.json' just to avoid the head scratching (I reinstalled the 3.1 sdk, restarted VS a couple times, restarted machine, then googled it and got here).

All 15 comments

This should be fixed in next 3.1 build. This was tested on a VAL build that we are not going to insert.

Installed release of Visual Studio 16.4 (which includes .NET Core 3.1). Unable to select 3.1 as target framework as described above.

@RoySalisbury Do you have a global.json specifying an earlier SDK then 3.1.100 by chance?

@nguerrera not that I can find. Not in the project folder or any parent folders.

If I change the project file manually to netcoreapp3.1, then the IDE complains about it not being defined in

"C:\Program Files\dotnet\sdk\3.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets"

So it looks like the IDE is still looking in the 3.0.1 directory and was not updated to look in the 3.1 directory.

Can you share dotnet --info run from the project directory?

I ran into this as well, I did have a global.json which limited it, then restarted VS and can see it now. This probably needs UI in Visual Studio along the lines of 'Targets are limited to 3.0.1 by current global.json' just to avoid the head scratching (I reinstalled the 3.1 sdk, restarted VS a couple times, restarted machine, then googled it and got here).

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise>dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.100
 Commit:    cd82f021f4

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18363
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.1.100\

Host (useful for support):
  Version: 3.1.0
  Commit:  65f04fb6db

.NET Core SDKs installed:
  2.1.600-preview-009497 [C:\Program Files\dotnet\sdk]
  2.1.602 [C:\Program Files\dotnet\sdk]
  2.1.604 [C:\Program Files\dotnet\sdk]
  2.1.700 [C:\Program Files\dotnet\sdk]
  2.1.701 [C:\Program Files\dotnet\sdk]
  2.2.104 [C:\Program Files\dotnet\sdk]
  2.2.200-preview-009804 [C:\Program Files\dotnet\sdk]
  2.2.203 [C:\Program Files\dotnet\sdk]
  2.2.300 [C:\Program Files\dotnet\sdk]
  3.0.101 [C:\Program Files\dotnet\sdk]
  3.1.100 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

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

Seems restarting Visual Studio did not help, but rebooting the OS did. Perhaps Visual Studio was holding a lock someplace on a file. But now I can choose 3.1.0 as the target framework.

Very odd..

i do not have a global.json located anywhere and i have this issue

.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26

Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x86
Base Path: C:\Program Files (x86)\dotnet\sdk\3.0.100\

Host (useful for support):
Version: 3.1.1
Commit: a1388f194c

.NET Core SDKs installed:
2.1.302 [C:\Program Files (x86)\dotnet\sdk]
2.2.402 [C:\Program Files (x86)\dotnet\sdk]
3.0.100 [C:\Program Files (x86)\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.6 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.6 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.0.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]

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

Hello,
I am facing the same issue - VS 2019 is not showing target the framework having .NetCore 3.0 and 3.1 version.

I have updated version of VS 2019, i.e. 16.1.3 and VS 2019 is updated on 6 May 2020.

I have tried enabling "use previews of .Net Core SDK" from tools, restarted VS and my system couple of times - but nothing works.

I have installed x64 and x86 SDK of 3.0 and 3.1 version in my machine. Initially tried with x64 and post that installed x86 SDK - but nothing works.

Please suggest, if any one has solution for the same.

Thanks in advance.

Regards,
Nitesh

Hello,
I am facing the same issue - VS 2019 is not showing target the framework having .NetCore 3.0 and 3.1 version.

I have updated version of VS 2019, i.e. 16.1.3 and VS 2019 is updated on 6 May 2020.

I have tried enabling "use previews of .Net Core SDK" from tools, restarted VS and my system couple of times - but nothing works.

I have installed x64 and x86 SDK of 3.0 and 3.1 version in my machine. Initially tried with x64 and post that installed x86 SDK - but nothing works.

Please suggest, if any one has solution for the same.

Thanks in advance.

Regards,
Nitesh

I have the same problem. I have not yet been able to come to a solution

I was able to resolve the issue where I could not see Target Framework for .NET Code 3.1 (3.1.3) in the selection drop down. I could see all the SDKs under the folder C:\Program Files\dotnet\sdk but they were all missing under C:\Program Files (x86)\dotnet\sdk and even in the list when I try the "dotnet --list-sdk" in command prompt. The trick was to install the x86 version of the SDK you need. I installed the x86 version of 3.1.302 I was now able to see 3.1 in the target framework under project properties. Make sure you close VS before installing.

Same/similar problem here with VS2019 16.8.2. Only .NET Frameworks show in my "Target framework:" list. Yet "dotnet --list-sdk" shows them all - including the one I want: "5.0.101 [C:\Program Files\dotnet\sdk]". Installing both x64 and x86 versions doesn't help. Checking Tools|Options|Preview Features|Use Previews of .NET Core SDK doesn't help.

Was this page helpful?
0 / 5 - 0 ratings