Another one of those many many similar issues, yet none of the solutions searched for, helped (see below which one are looked at).
At the moment of writing this, .NET Core v2.2 is out of preview, the latest version being v2.2.202 (release date, 02-04-2019).
I installed that one via "Install other frameworks", I installed the x64 one, all other versions I have installed earlier are also that version.
After installing, when I create a new project, it shows up:
But when I then open the properties, it does not:
dotnet --info
within the directory of the project, gives the following result:
.NET Core SDK (reflecting any global.json):
Version: 2.2.202
Commit: 8a7ff6789d
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:Program Filesdotnetsdk2.2.202
Host (useful for support):
Version: 2.2.3
Commit: 6b8ad509b6
.NET Core SDKs installed:
2.1.2 [C:Program Filesdotnetsdk]
2.1.4 [C:Program Filesdotnetsdk]
2.1.201 [C:Program Filesdotnetsdk]
2.1.202 [C:Program Filesdotnetsdk]
2.1.401 [C:Program Filesdotnetsdk]
2.1.505 [C:Program Filesdotnetsdk]
2.2.202 [C:Program Filesdotnetsdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.9 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.9 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.3 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.0.5 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.3-servicing-26724-03 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.9 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.2.3 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
I have tried:
- Create a global.json (SO answer), this only produced more errors as it could not load the project that is targeting v2.2
- Enable preview SDKs within Settings (SO answer)
- I have tried installing the x86 version, but that gave also more errors as it was confused about which one to use now. So that started complaining about .NET Standard not being installed.
- I have updated Visual Studio and Visual Studio Build Tools to the latest versions, which is 15.9.11 (release date, 02-04-2019)
- When I build via the command line
dotnet build
in the solution directory, it builds successfully, so it must be a visual studio thing.
- verified that only
C:Program Filesdotnet
is in the Environment Variables, so C:Program Files (x86)dotnet
is not present.
- Looked at these options, did all of them but I did not set the
MSBuildSDKsPath
environment variable since I have other projects also in need with 2.1. I checked that there is currently no MSBuildSDKsPath
set so it should not be forced to that version.
All of the above attempts of course involving restarting the computer or restarting VS.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…