question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"error : Version's parameters must be greater than or equal to zero." when setting versionHeightOffset negative

See original GitHub issue

Opening a separate issue, because it appears that #703 is now resolved, but there is another seemingly unrelated problem.

We frequently set versionHeightOffset to a negative value to make the vNext the same as current version + 1 upon release. But it is no longer functioning with a negative value (in 3.5.68-alpha).

F:\Users\shad\.nuget\packages\nerdbank.gitversioning\3.5.68-alpha\build\Nerdbank.GitVersioning.Inner.targets(17,5): error : Version's parameters must be greater than or equal to zero.
F:\Users\shad\.nuget\packages\nerdbank.gitversioning\3.5.68-alpha\build\Nerdbank.GitVersioning.Inner.targets(17,5): error : Parameter name: revision

The configuration used was

{
  "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
  "version": "0.5.0",
  "assemblyVersion": {
    "version": "0.4.1"
  },
  "versionHeightOffset": "-7",
  "publicReleaseRefSpec": [
    "^refs/heads/main$",
    "^refs/heads/master$",
    "^refs/heads/release/v\\d+\\.\\d+(?:\\.\\d+)?(?:\\.\\d+)?$",
    "^refs/tags/v\\d+\\.\\d+"
  ],
  "cloudBuild": {
    "buildNumber": {
      "enabled": true
    }
  },
  "release": {
    "branchName": "release/v{version}"
  }
}

I confirmed that setting versionHeightOffset to a positive value eliminates the error message, so there is some validation that didn’t exist in version 3.3.37 (the version we use in all of our other projects).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
NightOwl888commented, Jan 3, 2022

Yea, I have tried semver 2, but that really doesn’t solve the issue with patching a ported component that is version-aligned with the Java version.

1reaction
AArnottcommented, Jan 1, 2022

FYI You can override any nbgv version property in msbuild you want using a custom msbuild target:

<Target Name="Set4ComponentNugetVersion" AfterTargets="GetBuildVersion">
  <PropertyGroup>
    <NuGetPackageVersion>$(YourCustomVersion)</NuGetPackageVersion>
  </PropertyGroup>
</Target>

The GetBuildVersion target unconditionally sets many properties, but by scheduling your target to run right after, you can re-set them to whatever you want. Then, when the msbuild target runs that sets the c# attributes for your assembly, it’ll use the values you defined.

I don’t object to a new setting to allow 4-component nuget versions to be computed automatically though. If it did, would it just pull all 4 components from the same version used for AssemblyFileVersion? Would that work for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL Server 2008 R2 – Version's parameters must be greater ...
Message: Version's parameters must be greater than or equal to zero. Parameter name: build. In this particular case, it appears the SQL ...
Read more >
SQL Server Management Studio installation
SQL Server Setup has encountered the following error: Version's parameters must be greater than or equal to zero. Parameter name: build.
Read more >
Argument <argumentname> must be greater than or equal ...
Argument values must be greater than or equal to zero. To correct this error. Ensure that the argument's value is greater than or...
Read more >
ArgumentError: Paramters must be greater than zero. [sic] · ...
In split-4.0.0.pre , the dashboard page fails with an exception due to splitrb passing invalid parameters to BetaDistribution. ... I haven't got a ......
Read more >
Chocolatey Software | Visual Studio Online 1.0.1904-preview
This means it doesn't show up under normal search. Until approved, you should consider this package version unsafe - it could do very...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found