Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 663
C.Z. Avatar asked Jan 24 '26 23:01

C.Z.


1 Answers

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.

like image 199
Rod Avatar answered Jan 27 '26 00:01

Rod



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!