[英]meaning of Installed and Version columns in Nuget manage for solution
per the shared screenshot and you are managing packages for solutions.根据共享的屏幕截图,您正在管理解决方案的包。 You installed the version '17.0.6' of this specific package for the project 'Business_core' and 'CboDbProvider_core', then the 'Version' and 'Installed' is '17.0.6'(they are the same for the same project in here).您为项目“Business_core”和“CboDbProvider_core”安装了此特定 package 的版本“17.0.6”,然后“版本”和“已安装”为“17.0.6”(对于此处的同一项目,它们是相同的) ). For other projects, they are 'Blank' since you have not installed this specific package, please have a look at this document: https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio#manage-packages-for-the-solution .对于其他项目,它们是“空白”,因为您尚未安装此特定的 package,请查看此文档: https://learn.microsoft.com/en-us/nuget/consume-packages/install-use- packages-visual-studio#manage-packages-for-the-solution 。
We can install and use different versions of the same NuGet package across different projects in the same solution like the following screenshot:我们可以在同一个解决方案的不同项目中安装和使用同一个 NuGet package 的不同版本,如下图所示:
Then select the specific project and click 'Version' to choose a higher or lower version to update the installed version:然后select具体项目点击'Version'选择高版本或者低版本来更新安装的版本:
"Version" means requested, whereas "installed" is what was actually restored. “版本”表示请求,而“安装”是实际恢复的内容。 This only makes sense for projects using ProjectReference.这仅对使用 ProjectReference 的项目有意义。 For packages.config they'll always be the same value.对于 packages.config,它们将始终是相同的值。
A demonstration of when the two columns have different versions (with PackageReference) is if you modify your csproj to contain <PackageReference Include="Newtonsoft.Json" Version="13.0.0" />
.如果您修改 csproj 以包含<PackageReference Include="Newtonsoft.Json" Version="13.0.0" />
演示两列何时具有不同版本(使用 PackageReference)。 There is no version 13.0.0, the package author always starts with patch version 1, so NuGet will restore version 13.0.1 (and raise a warning).没有版本 13.0.0,package 作者始终从补丁版本 1 开始,因此 NuGet 将恢复版本 13.0.1(并发出警告)。 In this case you'll see the two columns have different values.在这种情况下,您会看到两列具有不同的值。
A more realistic example is if you use "floating versions".一个更现实的例子是如果你使用“浮动版本”。 For example, <PackageReference Include="Newtonsoft.Json" Version="13.*" />
.例如, <PackageReference Include="Newtonsoft.Json" Version="13.*" />
。 In the past VS would show the "installed" version as 13.0.0, but I think now it will show 13.*.过去 VS 会将“已安装”版本显示为 13.0.0,但我认为现在它会显示 13.*。 Note that floating versions have questions around when the package version will actually update once a new version is published to a feed your project uses, and also build determinism (more important when package authors don't follow SemVer and introduce breaking changes), so as someone who is risk adverse, I'd rather use Dependabot or similar, but different people have different preferences.请注意,浮动版本在 package 版本发布到您的项目使用的提要后何时实际更新存在疑问,并且还建立确定性(当 package 作者不遵循 SemVer 并引入重大更改时更重要),因此对于风险不利的人,我宁愿使用 Dependabot 或类似工具,但不同的人有不同的偏好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.