简体   繁体   English

如果我必须同时针对 Dot Net Core 3.0 和 .Net Framework 4.7.2,我应该在库中使用哪个 .Net 标准版本

[英]Which .Net standard version should i use in a library if i have to target both Dot Net Core 3.0 and .Net Framework 4.7.2

I have to migrate few existing Dot Net core 2.2 project to Dot Net core 3.1.我必须将一些现有的 Dot Net core 2.2 项目迁移到 Dot Net core 3.1。 There is a project which is devolved based on .Net Framework 4.7.2.有一个基于 .Net Framework 4.7.2 的项目。

So we have a common library developed based on .Net Standard 2.0 so that it can target both dotnet 2.2 and .Net framework 4.7.2.所以我们有一个基于 .Net Standard 2.0 开发的通用库,以便它可以同时针对 dotnet 2.2 和 .Net framework 4.7.2。

Now if i have to migrate my Dotnet core 2.2 to Dotnet core 3.1 and still continue to use the common library i would have to migrate the common libs to .Net Standard 2.1 (In order to support Dot net core 3.x) but this migration to .Net Standard 2.1 will not allow a .net framework project to use the common library.现在,如果我必须将我的 Dotnet core 2.2 迁移到 Dotnet core 3.1 并且仍然继续使用公共库,我将不得不将公共库迁移到 .Net Standard 2.1(为了支持 Dot net core 3.x)但是这个迁移到 .Net Standard 2.1 将不允许 .net 框架项目使用公共库。

Is there any way to handle this current situation?有什么办法可以处理目前的情况吗?

You don't need to update your .NET Standard libraries from 2.0 to 2.1.您不需要将 .NET Standard 库从 2.0 更新到 2.1。 You can still use them in your .NET Core 3.1 projects.您仍然可以在 .NET Core 3.1 项目中使用它们。 It works the other way if you switch to .NET Standard 2.1 then the version of the project that uses this library will have to be minimum .NET Core 3.0.如果您切换到 .NET Standard 2.1,则它会以另一种方式工作,那么使用此库的项目版本必须至少为 .NET Core 3.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .Net Core库应该针对哪个.Net框架? - Which .Net framework should my .Net Core library target? 我应该定位哪个版本的.NET框架? - What version of the .NET framework should I target? 我应该使用类库来定位.NET Framework和C#版本? - What .NET Framework and C# version should I target with my class library? 具有 4.7.2 目标框架版本的 C# 项目可以在 .net 4.6.1 上运行吗 - Can C# projects that have 4.7.2 target framework version run on .net 4.6.1 在 .Net Core 项目中使用 .Net Framework dll (v4.7.2) - Use .Net Framework dll (v4.7.2) in .Net Core project .net 标准库在 .net 核心中失败,但在框架中失败 - .net standard library fails in .net core but not in framework .NET Core SDK 2.2.1 和 .NET Framework 4.7.2 缺少 .NET Standard 2.0 Framework - Missing .NET Standard 2.0 Framework with .NET Core SDK 2.2.1 & .NET Framework 4.7.2 如何将 .NET 标准库更改为 .NET 框架库? - How can I change a .NET standard library to a .NET framework library? 面向 .NET Standard 时,我到底可以在我的项目中使用 .NET Core 和 .NET Framework 中的哪些内容? - When targeting .NET Standard, what exactly can I use from .NET Core and .NET Framework in my project? 如何在VS 2017 RC中创建针对.NET Framework 4.5.1和.NET Standard 1.3的库? - How should I create a library targetting .NET Framework 4.5.1 and .NET Standard 1.3 in VS 2017 RC?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM