本文介绍了将.Net Framework 4.6.2项目转换为.Net核心项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个解决方案,其中包含一堆由.Net Framework 4.6.2开发的类库.我必须将这些类库转换为.Net核心.有没有最好,最快的转换方法来重写代码.

I Have a solution which contains the bunch of class libraries which is developed by .Net framework 4.6.2. I have to convert those class libraries into .Net core. Is there any best and fastest way to convert instead for rewrite the code.

推荐答案

似乎是Microsoft进行迁移的官方资源.总结如下:

This appears to be an official Microsoft resource for doing the migration. Summarized below:

  1. (推荐)将所有要移植的项目重新定位为.NET Framework 4.7.2或更高版本.

  1. (recommended) Retarget all projects you wish to port to target the .NET Framework 4.7.2 or higher.

(推荐).使用.NET可移植性分析器分析程序集,并查看它们是否可移植到.NET Core.

(recommended) Use the .NET Portability Analyzer to analyze your assemblies and see if they're portable to .NET Core.

(推荐).将.NET API分析器安装到您的项目中,以识别在某些平台上引发PlatformNotSupportedException的API以及其他一些潜在的兼容性问题.

(recommended) Install the .NET API analyzer into your projects to identify APIs throwing PlatformNotSupportedException on some platforms and some other potential compatibility issues.

使用 Visual Studio中的转换工具.

为.NET Core创建新项目并复制源文件,或尝试使用工具转换现有项目文件.

Create new projects for .NET Core and copy over source files, or attempt to convert your existing project file with a tool.

移植您的测试代码.

这篇关于将.Net Framework 4.6.2项目转换为.Net核心项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 15:21