[英]How to change .NET Framework to .NET Standard/Core in Visual Studio?
I have a solution in C# in Visual Studios.我在 Visual Studios 中有一个 C# 解决方案。 It was first created in .NET Framework.它最初是在 .NET Framework 中创建的。 I want to convert the project to .NET Standard/Core.我想将项目转换为 .NET Standard/Core。 If I go into project --> properties I see the attached screen, where Target Framework is .NET Framework.如果我进入项目 --> 属性,我会看到附加的屏幕,其中 Target Framework 是 .NET Framework。 How am I able to change that to .NET Standard/Core?我如何才能将其更改为 .NET Standard/Core?
As Roman Ryzhiy mentions in the comments, this is the way to go:正如 Roman Ryzhiy 在评论中提到的,这是要走的路:
https://docs.microsoft.com/en-us/dotnet/core/porting/ https://docs.microsoft.com/en-us/dotnet/core/porting/
This worked fine for me, I upgraded a .NET Framework 4.7.2 projekt.这对我来说很好用,我升级了 .NET Framework 4.7.2 项目。 It was a small project, so I had few aftermath-problems.这是一个小项目,所以我几乎没有什么后果问题。 After the upgrade, the Target Framework in the Application tab will say ".NET 5.0".升级后,应用程序选项卡中的目标框架会显示“.NET 5.0”。
Install upgrade-assistant:安装升级助手:
dotnet tool install -g upgrade-assistant dotnet 工具安装 -g 升级助手
Go to your solution folder转到您的解决方案文件夹
Run the assistant:运行助手:
upgrade-assistant upgrade your-project-name.csproj升级助手升级您的项目名称.csproj
Follow the steps in the assistant, it's really straight-forward.按照助手中的步骤操作,非常简单。
Also, here are the steps more detailed:此外,以下是更详细的步骤:
https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview#installation-steps https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview#installation-steps
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.