Nuget Semver - what are allowed prerelease characters?

被刻印的时光 ゝ 提交于 2021-01-01 07:06:53

问题


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.

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

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

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

And I thought PIP is obtuse...


回答1:


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.

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.



来源:https://stackoverflow.com/questions/49103650/nuget-semver-what-are-allowed-prerelease-characters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!