have tried upgrading to the professional version of visual studio 2017 v 15.6.0 (Preview 7.0)
and installed aspnetcore-runtime-2.1.0-preview1-final-win-x64 and .net core SDK 2.1.4.
When I created a new web application I get an error saying
"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."
When I try to build an existing project I get an 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 don't see ".net core 2.1" in my target framework
I don't have global.json file in my computer
When I try dotnet --info, I get this
c:\source\dnacloud\testapp>dotnet --info .NET Command Line Tools (2.1.100)
Product Information: Version: 2.1.100 Commit SHA-1 hash: b9e74c6 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.100\ Microsoft .NET Core Shared Framework Host Version : 2.0.5 Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54
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).
Checking the Version of Your . It will open the command prompt with the project path. Execute the following command: dotnet --version . It will display your project's current SDK version,i.e., 2.1.
The problem here is that Microsoft confused a whole lot of people with how they numbered their .NET Core SDKs.
In the original poster's message the path C:\Program Files\dotnet\sdk\2.1.100\ DOES NOT appear to represent the .NET Core 2.1 runtime (but you'd think it does).
I came across this post The current .NET SDK does not support targeting .NET Core 2.1 on developercommunity.visualstudio.com where a Microsoft support person explains the confusion:
"Thank you for your feedback! We have determined that this issue is not a bug. The first SDK with .NET Core 2.1 support is 2.1.300-preview1. We know the versioning is confusing which is why starting in 2.1.300, the major.minor versions of the SDK will now be aligned with the major.minor versions of the runtime as well."
So ... in order to get .NET Core 2.1 support for building via the SDK you need to install the SDK with version 2.1.300 at least (since 2.1.2 is NOT .NET Core 2.1) ... yeah, confusing. Thank you Microsoft for some lost time on this.
This happened to me after installing 2.2.100-preview3-009430 and then updating to Visual Studio 15.9.2.
I resolved by enabling the "Use previews of the .NET Core SDK" option.
Go to: Tools > Options > Projects and Solutions > .NET Core
Check the "Use previews of the .NET Core SDK" box
Restart Visual Studio and rebuild the solution.
VS Preview Options
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