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.

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(4155)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2017-02-20 GridColumn (Column Layout and Auto Width)
2017-02-20 GaugeControl 之 DigitalGauge
2017-02-20 XtraForm
点击右上角即可分享
微信分享提示