Visual Studio 2019 未显示 .NET 5 框架 [英] Visual Studio 2019 Not Showing .NET 5 Framework

查看:99
本文介绍了Visual Studio 2019 未显示 .NET 5 框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试将 Visual Studio 中的 ASP.NET 项目从 .NET 4.7.2 框架升级到 .NET 5.我无法弄清楚问题是什么,因为我尝试了几种不同的方法他们都没有提供 .NET 5.

I've been trying to upgrade my ASP.NET project in Visual Studio from the .NET 4.7.2 framework to .NET 5. I can't figure out what the problem is, because I've tried several different things and none of them have made .NET 5 available.

  1. 我已经安装了最新版本的 Visual Studio Community 2019,版本 16.8.4.
  2. 我已经安装了 .NET 5.0.102.命令提示符确认了这一点,当我输入 dotnet --version.
  3. 在 Visual Studio 的工具>中选项 >环境 >预览功能,我已启用使用 .NET Core SDK 的预览",并重新启动程序.
  4. 在 Visual Studio 安装程序中,我选择了 Modify >个人组件..NET 5.0 运行时已安装,但什么也没有针对 .NET Framework 5 列出;列出的最高分是 4.8.
  5. 我已尝试重新启动程序和计算机,并重新安装 Visual Studio 和 .NET 5.0.102 框架.
  1. I've installed the latest version of Visual Studio Community 2019, version 16.8.4.
  2. I've installed .NET 5.0.102. The Command Prompt confirms this when I type dotnet --version.
  3. In Visual Studio's Tools > Options > Environment > Preview Features, I've enabled "Use previews of the .NET Core SDK", and restarted the program.
  4. In Visual Studio Installer, I've selected Modify > Individual components. The .NET 5.0 Runtime is installed, but there's nothing listed for a .NET Framework 5; the highest listed is 4.8.
  5. I've tried restarting the program and my computer, and reinstalling both Visual Studio and the .NET 5.0.102 framework.

Visual Studio 中的关于 窗口显示我的 .NET 版本是 4.8.040.我可以在我的项目中选择的最新 .NET 框架是 4.7.2.创建新项目也不会提供更新版本.

The About window in Visual Studio says that my .NET version is 4.8.040. The most recent .NET framework that I can select in my project is 4.7.2. Creating a new project doesn't offer a newer version either.

我想使用 C# 9.0,但我的项目停留在 7.3.知道我做错了什么吗?

I want to work with C# 9.0, but my project is stuck in 7.3. Any idea what I'm doing wrong?

推荐答案

.NET 5 不是 .NET Framework 4.5+ 的直接替代品.如果您尝试创建一个新项目并选择 .NET Framework,那么您将可以选择例如 4.7、4.8,但不能选择 .NET 5.

.NET 5 is not a direct replacement for .NET Framework 4.5+. If you try to create a new project and choose .NET Framework, then you will be able to choose for example 4.7, 4.8, but not .NET 5.

您只会在 .NET Core 类型的项目中找到 .NET 5.

You will only find .NET 5 in projects which are .NET Core type.

总而言之 - 您不能使用简单的项目属性窗口将 .NET Framework 项目切换到 .NET 5.您必须将应用程序重写为 .NET 5 - 这确实是 .NET Core 3.1 之后的下一个版本.

In summary - you can't switch .NET Framework project to .NET 5 using simple Project Property window. You have to rewrite the application to .NET 5 - which is indeed the next version after .NET Core 3.1.

关于您的问题:

我想使用 C# 9.0,但我的项目停留在 7.3.知道我做错了什么吗?

I want to work with C# 9.0, but my project is stuck in 7.3. Any idea what I'm doing wrong?

请查看C#语言版本页面.C# 8.0 可用于 .NET Framework 不支持的 netstandard2.1.与 C# 9.0 相同.

Please look at the C# language versions page. C# 8.0 is available for netstandard2.1 which is not supported by .NET Framework. Same thing with C# 9.0.

与 .NET Core 和 .NET Framework 相比,什么是 .NET 5 你可以在微软开发博客上阅读.

What is .NET 5 in comparison to .NET Core and .NET Framework you can read on Microsoft Dev Blog.

这篇关于Visual Studio 2019 未显示 .NET 5 框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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