I have downloaded and install Visual Studio 2019 and have dotnet core 3.1 installed. As I am starting to play around with VS, I have just created a simple project using VS built-in Web App Template and try to run without debugging.
It gives the error of "The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 3.0 or lower, or use a version of the .NET SDK that supports .NET Core 3.1."
May I know how it can be resolved?
Thanks.
Regards, Andrew
NET Core 3.1 was originally released on December 3, 2019 and is supported for three years. But the actual end of support day will be the closest Patch Tuesday starting that date, which is December 13, 2022.
You can see both the SDK versions and runtime versions with the command dotnet --info . You'll also get other environmental related information, such as the operating system version and runtime identifier (RID).
NET Core is cross-platform. It runs on Windows, OS X and multiple distributions of Linux. It also supports different CPU architectures.
If you already have the correct .NET Core 3.1 SDK installed it could be caused by a file called global.json
. This file allows to configure which SDK is used:
The global.json file allows you to define which .NET Core SDK version is used when you run .NET Core CLI commands. Selecting the .NET Core SDK is independent from specifying the runtime your project targets. The .NET Core SDK version indicates which versions of the .NET Core CLI is used.
Delete the file or change the defined SDK to 3.1:
{
"sdk": {
"version": "3.1.100",
"rollForward": "latestPatch",
"allowPrerelease": false
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With