![](/img/trans.png)
[英]The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 1.1 or lower
[英]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. Microsoft.AspNetCore.Identity.Test C:\Program Files\dotnet\sdk\2.1.4\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference
我嘗試構建Microsoft示例https://github.com/aspnet/Identity/tree/dev/samples/IdentitySample.Mvc
我安裝了Netcore SDK 2.1.4
dotnet --info
顯示2.0.5
為什么會出現錯誤?
dev分支始終以最新的每晚構建(2.1.0預覽版本)為目標。 使用其中一個標記,例如針對ASP.NET Core 2.0.0的rel/2.0.0
分支。 https://github.com/aspnet/Identity/tree/rel/2.0.0/samples/IdentitySample.Mvc 。
.NET Core 2.1尚未推出。 預計預計1將在第一季度晚些時候推出,預計將在第二季度全面發布。
對於那些在更一般的背景下絆倒這個問題的人來說,問題是.Net SDK 2.1.4不支持.Net Core 2.1。
SDK 2.1.300及更高版本支持.Net Core 2.1。
在此下載https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-rc1
這里的混淆來自CLI和.Net Core之間版本控制的差異。 SDK版本實際上是CLI版本,並且與支持的.Net Core版本不同。
值得慶幸的是,有計划對此進行整理,可以在此GitHub討論中找到更多信息https://github.com/dotnet/designs/pull/29
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.