[英]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.