将 .Net Framework 4.6.2 项目转换为 .Net 核心项目 [英] Convert .Net Framework 4.6.2 project to .Net core project
问题描述
我有一个解决方案,其中包含由 .Net 框架 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.
推荐答案
This 似乎是进行迁移的官方 Microsoft 资源.总结如下:
This appears to be an official Microsoft resource for doing the migration. Summarized below:
(推荐) 将您希望移植的所有项目重新定位到 .NET Framework 4.7.2 或更高版本.
(recommended) Retarget all projects you wish to port to target the .NET Framework 4.7.2 or higher.
(推荐)使用 .NET Portability Analyzer 分析您的程序集,看看它们是否可以移植到 .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.
为 .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 核心项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!