即使我使用的是 .Net Core 3.1,我是否可以更新到 .Net 5 NuGet 包? [英] Can I update to .Net 5 NuGet packages even if I'm using .Net Core 3.1?

查看:22
本文介绍了即使我使用的是 .Net Core 3.1,我是否可以更新到 .Net 5 NuGet 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关我的项目库的一些 NuGet 更新.我看到有很多 Microsoft 库更新到 v5.0.0.

I was looking for some NuGet updates about my project libraries. I see that there are a lot of Microsoft libraries update to v5.0.0.

据我所知,我认为这些是随 .Net 5.0 发布的新依赖项,我不确定是否可以使用 .Net Core 3.1 项目将这些库更新到最新版本.

Based on my knowledge I think these are new dependencies released with .Net 5.0 and I'm not sure that I can update these libraries to latest version using .Net Core 3.1 project.

即使我正在使用/构建 .Net Core 3.1 项目,我也可以更新到 v5.0.0 库吗?

Can I update to v5.0.0 libraries even if I'm using/building a .Net Core 3.1 project?

推荐答案

很遗憾,您无法将许多最新的 Nuget 包更新到 5.0.原因是最新的 Nuget 包版本主要是为 .NET 5 编写的,而且由于 API 存在差异,Nuget 包管理器通常甚至会阻止您安装它们.话虽如此,可能会有一些地方允许安装,但如果您打算将应用程序保留在 .NET Core 3.1 上,我不建议您这样做.它很可能会导致一些难以调试的不一致.请谨慎行事,或将您的项目升级到 .NET 5.

Unfortunately, you cannot update many of these newest Nuget packages to 5.0. The reason being is that the newest Nuget package versions are written primarily for .NET 5, and often times Nuget Package Manager will even prevent you from installing them since there are differences in the APIs. With that said, there may be a few spots where it will allow the installation, but I wouldn't recommend it if you plan to keep the application on .NET Core 3.1. Most likely it could cause some inconsistencies that would be hard to debug. Proceed with caution, or upgrade your projects to .NET 5.

这篇关于即使我使用的是 .Net Core 3.1,我是否可以更新到 .Net 5 NuGet 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆