Amarjeet Chaurasia
Amarjeet Chaurasia

Reputation: 23

which .NET SDK version project refer if there are multiple version installed on system?

I have 2.1.4 version of .NET SDK installed on the system but I was getting "The current .NET SDK does not support targeting .NET Core 2.1. target .NET Core 2.0 or lower or use a vs of the .NET SDK that support NET Core 2.1" error on opening an existing project.

Now I have installed 2.2.104 version for .NET SDK along with existing one. So which version of SDK my project is referring now, I'm not sure. Can someone please help on this.

Upvotes: 0

Views: 1263

Answers (1)

omajid
omajid

Reputation: 15223

Your confusion is probably because you think SDK 2.1.x (2.1.4) should be able to target .NET Core 2.1. That's unfortunately not true. As you can see on the .NET Core 2.0 download site, the .NET Core 2.1.4 SDK is for .NET Core 2.0!

If you want to target .NET Core 2.1, you need SDK version 2.1.300 or later. SDK 2.2.104 should be good enough for this.

If you have installed multiple .NET Core SDKs, the latest (the one with the highest version number) is the one used by default. You can run dotnet --info to see all the installed SDK and Runtimes. It will also tell if you if a global.json file is making .NET Core use another SDK instead of the latest. You can use a global.json file to force a different version of .NET Core SDK to be used.

Upvotes: 2

Related Questions