Nuget 3.5 在打包时去掉前导零 [英] Nuget 3.5 strips off leading zeros when it packs a package

查看:41
本文介绍了Nuget 3.5 在打包时去掉前导零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 v3.5 中,行为发生了变化,因此当它打包一个包时,它会去掉前导零.这不是我们想要的行为.我希望它可以在 v3.6 中修复.

解决方案

包版本控制页面为 NuGet 3.4 及更高版本引入了一项重大更改,这需要版本号的规范化":

<块引用>

在安装、重新安装或还原操作期间从存储库获取包时,NuGet 3.4+ 将版本号处理如下:

从版本号中删除前导零:

1.00 被视为 1.01.01.1 被视为 1.1.11.00.0.1 被视为 1.0.0.1

版本号第四部分的零将被省略

 1.0.0.0 被视为 1.0.01.0.01.0 被视为 1.0.1

<块引用>

这种规范化不会影响包本身的版本号;它仅影响 NuGet 在解析依赖项时匹配版本的方式.

我知道的唯一解决方法是使用 下载页面 的 nuget 3.3.0 版.

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.

解决方案

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.

这篇关于Nuget 3.5 在打包时去掉前导零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆