I've just downloaded the release version of .NET Core 3.0.100
It was installed alongside older version that I have:
When I try to run dotnet restore
for a project that targets .NET Core 3 (<TargetFramework>netcoreapp3.0</TargetFramework>
), I get this error
C:\Program Files\dotnet\sdk\2.2.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0.
I have a global.json file that explicitly states that I need the 3.0.100
SDK
{ "sdk": { "version": "3.0.100" } }
I know that I can edit the MSBuildSDKsPath
env variable to point to the 3.0.100
SDK, and it works, but I don't want to do it, I have other projects on my machine that still need to use older versions of .NET Core.
Is there a way to make the dotnet
tool use the SDK that's stated in global.json
instead of the one in MSBuildSDKsPath
?
Edit: I use Visual Studio Code
NET SDK version, you also need to set the option to enable previews in Visual Studio. Go to Tools > Options > Environment > Preview Features, and make sure that Use previews of the . NET Core SDK is checked.
The software development kit (SDK) includes everything you need to build and run . NET Core applications, using command-line tools and any editor (like Visual Studio). The runtime includes everything you need to run . NET Core applications.
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 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.
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."
the current SDK package for .NET does not support the target object .NET Core 6.0. Select .NET Core 5.0 or earlier, or use the version of the .NET SDK that supports .NET Core 6.0. Question: How to fix the error? I couldn't figure out the best area label to add to this issue.
blog.matrixpost.net Visual Studio The current .NET SDK does not support targeting .NET Core. The current .NET SDK does not support targeting .NET Core. by Marcus Rath 15. May 2021 If you run into an .NET Core compiling error regarding targeting .NET Core version not supported in Visual Studio like this one:
.NetSDK – Build – Error – NETSDK1045 – “The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 3.0 or l ower, or use a version of the .NET SDK that supports .NET Core 3.1.” | Learning in the Open Home .NetSDK – Build – Error – NETSDK1045 – “The current .NET SDK does not support targeting .NET Core 3.1.
You also have to update your visual studio
to the minimum supported version:
visual studio v16.3
visual studio v16.5
visual studio v16.6 latest preview
visual studio v17.0 latest preview
(https://dotnet.microsoft.com/download/dotnet-core/3.0)
(https://dotnet.microsoft.com/download/dotnet-core/3.1)
(https://dotnet.microsoft.com/download/dotnet/5.0)
(https://dotnet.microsoft.com/download/dotnet/6.0)
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