Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE]: There's no NuGetVersionV2 anymore, and no zero-padded PreReleaseNumber #4153

Closed
2 tasks done
Jaykul opened this issue Aug 11, 2024 · 6 comments
Closed
2 tasks done

Comments

@Jaykul
Copy link

Jaykul commented Aug 11, 2024

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.0.1

Operating system

N/A

What are you seeing?

I was porting settings from a PowerShell module, and I get this error:

Unable to format AssemblyInformationalVersion. Check your format string: 'NuGetVersionV2' is not a member of type 'GitVersion.SemanticVersionFormatValues' (Parameter 'propertyOrFieldName')

What is expected?

I expected to be able to build a version like "1.2.3-beta0002" so I can upload packages to the PowerShell gallery. chocolatey, and other old nuget-based servers.

Note that the FAQ still refers to a NuGetVersionV2

Steps to Reproduce

Try using this in your GitVersion.yml

assembly-informational-format: '{NuGetVersionV2}'

The FAQ still refers to a NuGetVersionV2

RepositoryFixture Test

No response

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

No response

@arturcic
Copy link
Member

@Jaykul
Copy link
Author

Jaykul commented Aug 11, 2024

So we need to stay on 5.x in order to version packages for anything that's not SemVer 2 -- like the official PowerShell gallery.

@asbjornu
Copy link
Member

So we need to stay on 5.x in order to version packages for anything that's not SemVer 2 -- like the official PowerShell gallery.

Unfortunately, yes. But as a fix to this issue and probably a few other issues as well, would be for GitVersion to support arbitrary C# format strings, so you could create your own padded version number as such:

assembly-informational-format: '{Major}.{Minor}.{Patch}-{CommitsSinceVersionSource:0000}'

Something like that would be very powerful and definitely something I'd welcome pull requests for.

@HHobeck
Copy link
Contributor

HHobeck commented Aug 12, 2024

So we need to stay on 5.x in order to version packages for anything that's not SemVer 2 -- like the official PowerShell gallery.

Unfortunately, yes. But as a fix to this issue and probably a few other issues as well, would be for GitVersion to support arbitrary C# format strings, so you could create your own padded version number as such:

assembly-informational-format: '{Major}.{Minor}.{Patch}-{CommitsSinceVersionSource:0000}'

Something like that would be very powerful and definitely something I'd welcome pull requests for.

Do you know if already a feature ticket has been raised for this?

@asbjornu
Copy link
Member

Do you know if already a feature ticket has been raised for this?

@HHobeck, no I created #4156 for it just now.

@ericnewton76
Copy link

ericnewton76 commented Sep 10, 2024

I'm actually baffled as to why NuGetVersionV2 was removed... in favor of something more complicated like adding parsing of format strings into a config variable... ???

if NuGetVersionV2 was complicated to calculate then I can understand... theres a lot of people, inclding myself using GitVersion to properly calculate a usable NuGet version...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants