.NET Core 3.1 Missing From Target Framework in VS2019

I cloned a repository that was targeting .NET Core 3.1. Trying to run it in VS 2019 ended with this error:

The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 2.0 or lower, or use a version of the .NET SDK that supports .NET Core 2.1.

I looked at the properties of the project and I couldn’t see anything higher than .NET Core 2.2 in my Target frameworks list.

Picture of target framework dropdown in visual studio

I spent more hours that I care to admit to here. I checked that .NET Core 3.1 both x64 and x32 were installed. They were.

I checked that C:\Program Files\dotnet was in my Path. It was.

It turned out that I had a global.json file in my root C:\Code folder, where I have all my local code projects, that was limiting my targeting of any child folders to 2.2.

Picture of sdk version in global.json file in visual studio

I removed that global.json file and voila! I can now see .NET Core 3.1.

 
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x