I had installations of both Visual Studio 2019 and 2017. I tried installing the .NET Core 2.X SDK for VS2017 separately but with no luck.
The issue is, that I have .NET Core 3.0 SDK installed as default sdk-version, which VS2017 does not like.
My solution was to switch the SDK version for the specific project.
$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.100
Commit: cd82f021f4
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
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:
1.1.14 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.509 [C:\Program Files\dotnet\sdk]
2.2.110 [C:\Program Files\dotnet\sdk]
3.0.100 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]
$ dotnet new globaljson --sdk-version 2.2.110 --force
Now, dotnet
will use the specified SDK version for this solution.
I have not found a way to do this system-wide without also messing up my 3.0 projects.