Skip to content

[ISSUE]: dotnet publish: '0.0.1-abc_def.1+1' is not a valid version string #4136

@HenrikRoosKpa

Description

@HenrikRoosKpa

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.Tool

GitVersion version

6

Operating system

Windows

What are you seeing?

dotnet publish show an error: '0.0.1-abc_def.1+1' is not a valid version string, when branch name contains _.

What is expected?

FullSemVer generate an SemVer 2.0 string.

Steps to Reproduce

New-Item -Path test -Type Directory
cd test
git init
dotnet new web -o src/my-app
git add .
git commit -m "add my-app"
git checkout -b features/abc_def
dotnet-gitversion /showvariable FullSemVer
dotnet publish src/my-app -p:Version=0.0.1-abc_def.1+1 -o out

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

dotnet publish src/my-app -p:Version=0.0.1-abc_def.1+1 -o out
  Determining projects to restore...
C:\Program Files\dotnet\sdk\8.0.303\NuGet.targets(169,5): error : '0.0.1-abc_def.1+1' is not a valid version string. (Parameter 'value') [C:\git\test\src\my-app\my-app.csproj]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions