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

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

仔细查看后,发现置顶了preview 《The current .NET SDK does not support targeting .NET Core 3.0》

 

 

 

打开project,查看项目的target framework,有install other frameworks的选项

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

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  

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

 

 

解决方法

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

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

 

打开preview的开关

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

 

安装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.

 

    原文作者:ChuckLu
    原文地址: https://www.cnblogs.com/chucklu/p/10405977.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞