当前的 .NET SDK 不支持在 Visual Studio 2017 更新 15.3 中定位 .NET Standard 2.0 错误 [英] The current .NET SDK does not support targeting .NET Standard 2.0 error in Visual Studio 2017 update 15.3

查看:49
本文介绍了当前的 .NET SDK 不支持在 Visual Studio 2017 更新 15.3 中定位 .NET Standard 2.0 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 Target Framework .NET Standard 2.0 创建一个类库项目.

I want to create a class library project with Target Framework .NET Standard 2.0.

我已将我的 Visual Studio 2017 更新到版本 15.3 并且还在 Visual Studio 安装程序中检查了 .NET Framework 4.7 SDK.NET Framework 4.7 目标包手动安装.

I've updated my Visual Studio 2017 to Version 15.3 and also in Visual Studio installer checked .NET Framework 4.7 SDK and .NET Framework 4.7 targeting pack manually and installed them.

项目/应用程序窗口的目标框架组合框中仍然没有 .NET Standard 2.0 选项.所以我将 .csproj 文件中的 TargetFramework 标记手动更改为 netstandard2.0,但在尝试构建后出现此错误:

There is still no .NET Standard 2.0 option in the Target Framework combo box in the Project/Application window. So I changed TargetFramework tag in .csproj file manually to netstandard2.0, but after trying to build I get this error:

当前的 .NET SDK 不支持面向 .NET Standard 2.0.以 .NET Standard 1.6 或更低版本为目标,或使用 .NET 版本支持 .NET Standard 2.0 的 SDK.

The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0.

推荐答案

听起来为该特定版本安装 VS2017 更新并没有安装 .NET Core 2.0 SDK.您可以在此处下载.

It sounds like installing the VS2017 update for that specific version didn't also install the .NET Core 2.0 SDK. You can download that here.

要检查您已经安装了哪个版本的 SDK,请运行

To check which version of the SDK you've already got installed, run

dotnet --info

从命令行.请注意,如果您当前的工作目录或任何祖先目录中存在 global.json 文件,它将覆盖运行的 SDK 版本.(例如,如果您想为项目强制执行特定版本,这很有用.)

from the command line. Note that if there's a global.json file in either your current working directory or any ancestor directory, that will override which version of the SDK is run. (That's useful if you want to enforce a particular version for a project, for example.)

从评论来看,某些版本的 VS2017 更新确实安装了 .NET Core SDK.我怀疑它可能会随着时间的推移而有所不同.

Judging by comments, some versions of VS2017 updates do install the .NET Core SDK. I suspect it may vary somewhat over time.

这篇关于当前的 .NET SDK 不支持在 Visual Studio 2017 更新 15.3 中定位 .NET Standard 2.0 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆