Nuget 3.5 strips off leading zeros when it packs a package [closed]

旧街凉风 提交于 2021-01-04 07:05:05

问题


In v3.5 the behaviour has changed so that when it packs a package it will strip off leading zeros. This is not the behaviour we want. I hope it can be fixed in v3.6.


回答1:


As explained on the Package versioning page there was a breaking change introduced for NuGet 3.4 and later which entails "normalization" of the version numbers:

When obtaining packages from a repository during install, reinstall, or restore operations, NuGet 3.4+ treats version numbers as follows:

Leading zeroes are removed from version numbers:

1.00 is treated as 1.0
1.01.1 is treated as 1.1.1
1.00.0.1 is treated as 1.0.0.1

A zero in the fourth part of the version number will be omitted

  1.0.0.0 is treated as 1.0.0
  1.0.01.0 is treated as 1.0.1

This normalization does not affect the version numbers in the packages themselves; it affects only how NuGet matches versions when resolving dependencies.

The only workaround I am aware of is to use version 3.3.0 of nuget from download page.



来源:https://stackoverflow.com/questions/42377489/nuget-3-5-strips-off-leading-zeros-when-it-packs-a-package

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!