问题
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