The current .NET SDK does not support targeting .NET Core 3.0


編譯錯誤

Severity Code Description Project File Line Suppression State
Error NETSDK1045 The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. TestApp C:\Program Files\dotnet\sdk\2.1.504\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 137

 

官方只提供了 .net core 2.2

https://dotnet.microsoft.com/download

仔細查看后,發現置頂了preview 

 

 

 

打開project,查看項目的target framework,有install other frameworks的選項

https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral

.NET Core 3.0.0 Preview 2 - January 29, 2019

https://github.com/dotnet/core/blob/master/release-notes/3.0/preview/3.0.0-preview2.md  

 

https://github.com/dotnet/core/blob/master/release-notes/3.0/preview/3.0.0-preview8-download.md

 dotnet-sdk-3.0.100-preview8-013656-win-x64.exe

 

解決方法

安裝 dotnet-sdk-3.0.100-preview-010184-win-x64.exe

 

 

打開preview的開關

安裝了上面的preview,vs里面才會有勾選。另外升級vs16.2.2會導致這個失效?

新版本換了配置的地方https://developercommunity.visualstudio.com/content/problem/388470/target-framework-net-core-30-not-available.html

Have you enabled previews of .NET Core in Visual Studio: tools -> options -> environment -> preview features?

 

 

安裝vs2019

To create or open applications targeting .NET Core 3.0, Visual Studio 2019 or newer is required. Click the following link to download the latest version of Visual Studio 2019. If you are after an offline installation follow these instructions on how to install offline.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM