Visual Studio 不在目标框架下拉列表中显示 .NET Core 2.2 [英] Visual Studio does not display .NET Core 2.2 in Target Framework dropdown

查看:31
本文介绍了Visual Studio 不在目标框架下拉列表中显示 .NET Core 2.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚克隆到一个现有的工作项目中,并发现由于某种原因,Visual Studio 拒绝在属性"->应用程序"菜单的目标框架"下拉菜单中显示 .NET Core 2.2.

I just cloned into an already existing project for work, and have found that for some reason, Visual Studio refuses to show .NET Core 2.2 in the "Target Framework" dropdown menu in the Properties -> Application menu.

我已经安装了 .NET Core 2.2(通过单击安装其他框架"并下载/运行 2.2 SDK 文件.我最初安装的是 x64 版本,因为这是我老板使用的,但后来我也安装了 x84 版本以看看是否有效.两者都无效.),并确认已正确安装.我通过在 shell 中运行命令dotnet --info"来做到这一点,它输出以下内容:

I have installed .NET Core 2.2 (by clicking "install other frameworks" and downloading/running the 2.2 SDK file. I have originally installed the x64 version as that's what my boss uses, but I later also installed the x84 version to see if that worked. Neither works.), and confirmed that this is correctly installed. I did this by running the command "dotnet --info" in the shell, which outputs the following:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.101
 Commit:    236713b0b7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.16299
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:Program Filesdotnetsdk2.2.101

Host (useful for support):
  Version: 2.2.0
  Commit:  1249f08fed

.NET Core SDKs installed:
  1.1.11 [C:Program Filesdotnetsdk]
  2.2.101 [C:Program Filesdotnetsdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.0 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.0 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.13 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
  Microsoft.NETCore.App 1.1.10 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]

仍然,目标框架下拉列表中没有 .NET Core 2.2.目前只有两个选项:.NETCoreApp 1.0.NETCoreApp 1.1

Still, there are no .NET Core 2.2 in the Target Framework dropdown. There are only two options currently: .NETCoreApp 1.0 and .NETCoreApp 1.1

我有 Visual Studio 2017,据我所知从关于"页面可以看出,版本 15.0.0

I've got Visual Studio 2017, and as far as I can tell from the About page, version 15.0.0

推荐答案

您的 Visual Studio 版本不是最新的.你需要更新它.

Your Visual Studio Version is not up to date. You need to update it.

Visual Studio 2017 15.9 在安装工作负载后默认使用 .NET Core 2.1 SDK.

Visual Studio 2017 15.9 uses .NET Core 2.1 SDK by default after the workload is installed.

更新 Visual Studio 以使用 .NET Core 2.2 SDK:

To update Visual Studio to use .NET Core 2.2 SDK:

安装 .NET Core 2.2 SDK.

Install the .NET Core 2.2 SDK.

参考

PS:需要重启visual studio.安装 .Net Core 2.2 SDK 后.

PS: You need to restart visual studio. After you the installation of .Net Core 2.2 SDK.

这篇关于Visual Studio 不在目标框架下拉列表中显示 .NET Core 2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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