Nuget Semver-允许使用哪些预发行字符? [英] Nuget Semver - what are allowed prerelease characters?

查看:35
本文介绍了Nuget Semver-允许使用哪些预发行字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对我的一个.Nuget软件包(.Net Core 2)使用semantiv版本控制.版本看起来像这样1.0.0-my_fancy_branch.123.

I'm trying to use semantiv versioning for one of my .Nuget Packages (.Net Core 2) The Version looks like this 1.0.0-my_fancy_branch.123.

您可能会猜到,我尝试将分支名称和当前的BuildId设置为预发布标签.

As you can guess, I try to set the branch name and the current BuildId as a prerelease tag.

不幸的是,dotnet构建会产生以下错误: ...不是有效的版本字符串.

Unfortunately, dotnet build spews this error: ... is not a valid version string.

但是为什么呢?dotnet push/nuget的绝对非常好文档中没有列出任何禁止使用的字符.

But why? The absolutely great documentation of dotnet push / nuget does not list any forbidden characters.

我以为画中画很钝...

And I thought PIP is obtuse...

推荐答案

根据语义版本控制从NuGet 4.3.0开始的2.0.0 版本.在早期版本中,仅支持SemVer 2.0.0的一个子集,但这仍然可以提示指定版本存在问题的地方.

According to the reference on NuGet package versions, NuGet uses Semantic Versioning 2.0.0 starting with NuGet 4.3.0. In earlier versions only a subset of SemVer 2.0.0 is supported, but this may still give a hint where the problem with the specified version is.

第9节中(关于预发行版本)指定标识符必须仅包含ASCII字母数字和连字符[0-9A-Za-z-]".因此,我想您遇到的问题是预发行版本中的下划线.

In Section 9 (about pre-release versions) it is specified that "Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-].". Hence, I guess that the problems in your case are the underscores in the pre-release version.

这篇关于Nuget Semver-允许使用哪些预发行字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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