我一直在尝试将 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.
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 框架
发布评论