Ubiquity.NET.Versioning 6.0.1

dotnet add package Ubiquity.NET.Versioning --version 6.0.1
                    
NuGet\Install-Package Ubiquity.NET.Versioning -Version 6.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ubiquity.NET.Versioning" Version="6.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ubiquity.NET.Versioning" Version="6.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Ubiquity.NET.Versioning" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ubiquity.NET.Versioning --version 6.0.1
                    
#r "nuget: Ubiquity.NET.Versioning, 6.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ubiquity.NET.Versioning@6.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ubiquity.NET.Versioning&version=6.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Ubiquity.NET.Versioning&version=6.0.1
                    
Install as a Cake Tool

About

The Ubiquity.NET.Versioning library provides types to support use of versioning via

  1. Semantic Versioning
  2. Constrained Semantic Versioning
    • Including Continuous Integration (CI) via CSemVer-CI

It is viable as a standalone package to allow validation of or comparisons to versions reported at runtime. (Especially from native interop that does not support package dependencies or versioning at runtime.)

Example

var quad = new FileVersionQuad(SomeAPiThatRetrievesAFileVersionAsUInt64());
// ...
// NOTE: Since all that is available is a QUAD, which has only 1 bit for CI information,
// there is no way to translate that to a formal CSemVer-CI. Just test ordering of the
// quad.
if(quad > MinimumVer.FileVersion)
{
    // Good to go!
    if( quad.IsCiBuild )
    {
        // and it's a CI build!
    }
}

// ...
static readonly CSemVer MinimumVer = new(1,2,3/*, ...*/);

Formatting

The library contains support for proper formatting of strings based on the rules of a SemVer, CSemVer, and CSemVer-CI. The formatting is done case preserving when possible (Some cases of CSemVer will use string substitution such that PreRelease would simply become pre).

Parsing

The library contains support for parsing of strings based on the rules of a SemVer, CSemVer, and CSemVer-CI

Ordering

The types all support IComparable<T><sup>1</sup> and properly handle correct sort ordering of the versions according to the rules of SemVer (Which, CSemVer and CSemVer-CI follow with the exception of explicit case insensitivity for AphaNumeric IDs)

The formal 'spec' for CSemVer remains mostly silent on the point of the short format. See this known issue. Since, the existence of that form was to support NuGet V2, which is now obsolete, this library does not support the short form at all. (This choice keeps documentation clarity [NOT SUPPORTED] and implementation simplicity)


<sup><a id="footnote_1">1</a></sup>Unfortunately, major repositories using SemVer have chosen to use different comparisons. Thus, a consumer is required to know a-priori if the version is compared insensitive or not. Thus all constructors accept an enum indicating the sort ordering to use. Additional, parsing accepts an IFormatProvider, which should provide an AlphaNumeircOrdering value to specify the ordering. If none is provided, the default is used. (SemVer uses CaseSensitive comparisons, CSemVer and CSemVerCI ALWAYS use case insensitive) IComparer<SemVer> instances are available for cases where the versions are from mixed sources and the application wishes to order the versions.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Ubiquity.NET.Versioning:

Package Downloads
Ubiquity.NET.Llvm.Interop

.NET Low Level Interop Bindings for Ubiquity.LibLLVM []. Direct use of this low level API is **STRONGLY** discouraged, instead you should use the Ubiquity.NET.Llvm package, which provides a full C# object model projection of the LLVM APIs on top of this library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.1 163 7/15/2025
6.0.1-beta 132 7/14/2025
6.0.1-alpha 135 7/10/2025
5.0.4 89 6/28/2025
5.0.3-alpha 80 6/27/2025
5.0.1-alpha 79 6/27/2025
5.0.0-rc.1 266 6/10/2025
5.0.0-rc 200 6/4/2025
4.0.0-a 139 5/21/2025