Nuget Semver - 允许哪些预发行角色? [英] Nuget Semver - what are allowed prerelease characters?
问题描述
我正在尝试对我的一个 .Nuget 包(.Net Core 2)使用语义版本控制版本看起来像这样 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 build 出现了这个错误:... 不是有效的版本字符串.
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.
我认为 PIP 很钝...
And I thought PIP is obtuse...
推荐答案
根据 NuGet 包版本,NuGet 使用 语义版本控制2.0.0 从 NuGet 4.3.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屋!