[英]How to use a more recent version of a NuGet package for dependent packages in .NET Core 3.1?
I have a NuGet package that references Newtonsoft.Json v 12.0.2.我有一个引用 Newtonsoft.Json v 12.0.2 的 NuGet 包。 I can't access the source to that NuGet package.
我无法访问该 NuGet 包的源代码。 (Technically, NuGet Package Explorer stats that it's really >= 12.0.2 )
(从技术上讲,NuGet 包资源管理器统计它确实 >= 12.0.2 )
If I wish for that package to leverage Newtonsoft.Json v 12.0.3, is it as simple as me "installing" v 12.0.3 into my project and all dependants (and their children, etc) which are using v 12.0.2 will now be magically using my installed 12.0.3 version?如果我希望该软件包能够利用 Newtonsoft.Json v 12.0.3,是否就像我将 v 12.0.3“安装”到我的项目中一样简单,并且所有使用 v 12.0.2 的依赖项(及其孩子等)都将现在神奇地使用我安装的 12.0.3 版本?
Or does each dependency only use the version explicitly defined in their package?还是每个依赖项仅使用其包中明确定义的版本?
What is this called?这个叫什么? explicit referencing?
显式引用?
Other Info: This is for .NET Core 3.1其他信息:这适用于 .NET Core 3.1
For the new sdk project, when you install a nuget package, it will install its lowest dependencies on your project and if you want to use the higher version, you only need to install the updated dependency nuget package separately and then it will update all the dependencies to the updated version.对于新的sdk项目,当你安装一个nuget包时,它会在你的项目上安装它最低的依赖,如果你想使用更高的版本,你只需要单独安装更新的依赖nuget包,然后它会更新所有的对更新版本的依赖。
And it will update all dependencies of your project to that version.它会将您项目的所有依赖项更新到该版本。 Note that it will not act on a single nuget package but all.
请注意,它不会对单个 nuget 包起作用,而是对所有包起作用。
These two nuget packages used Newtonsoft.Json 12.0.2
dependency这两个nuget包使用了
Newtonsoft.Json 12.0.2
依赖
And if I install Newtonsoft.Json 12.0.3
nuget package separately:如果我安装
Newtonsoft.Json 12.0.3
分别NuGet包:
They all used Newtonsoft.Json 12.0.3
and it proves that they are Shared rather than using a separate version.他们都使用了
Newtonsoft.Json 12.0.3
,这证明它们是共享的,而不是使用单独的版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.