Semver 2.3.0
dotnet add package Semver --version 2.3.0
NuGet\Install-Package Semver -Version 2.3.0
<PackageReference Include="Semver" Version="2.3.0" />
paket add Semver --version 2.3.0
#r "nuget: Semver, 2.3.0"
// Install Semver as a Cake Addin
#addin nuget:?package=Semver&version=2.3.0
// Install Semver as a Cake Tool
#tool nuget:?package=Semver&version=2.3.0
A Semantic Version Library for .Net
Create, parse, and manipulate semantic version numbers with the SemVersion
class and semantic
version ranges with the SemVersionRange
class. This library complies with v2.0.0 of the semantic
versioning spec from semver.org.
API docs for the most recent release are available online at semver-nuget.org.
Parsing
var version = SemVersion.Parse("1.1.0-rc.1+e471d15", SemVersionStyles.Strict);
Constructing
var v1 = new SemVersion(1, 0);
var vNextRc = SemVersion.ParsedFrom(1, 1, 0, "rc.1");
Comparing
if (version.ComparePrecedenceTo(vNextRc) == 0)
Console.WriteLine($"{version} has the same precedence as {vNextRc}");
if (version.CompareSortOrderTo(vNextRc) > 0)
Console.WriteLine($"{version} sorts after {vNextRc}");
Outputs:
1.1.0-rc.1+e471d15 has the same precedence as 1.1.0-rc.1
1.1.0-rc.1+e471d15 sorts after 1.1.0-rc.1
Manipulating
Console.WriteLine($"Current: {version}");
if (version.IsPrerelease)
{
Console.WriteLine($"Prerelease: {version.Prerelease}");
Console.WriteLine($"Next release version is: {version.WithoutPrereleaseOrMetadata()}");
}
Outputs:
Current: 1.1.0-rc.1+nightly.2345
Prerelease: rc.1
Next release version is: 1.1.0
Version Ranges
var range = SemVersionRange.Parse("^1.0.0");
var prereleaseRange = SemVersionRange.ParseNpm("^1.0.0", includeAllPrerelease: true);
Console.WriteLine($"Range: {range}");
Console.WriteLine($"Prerelease range: {prereleaseRange}");
Console.WriteLine($"Range includes version {version}: {range.Contains(version)}");
Console.WriteLine($"Prerelease range includes version {version}: {prereleaseRange.Contains(version)}");
// Alternative: another way to call SemVersionRange.Contains(version)
version.Satisfies(range);
// Alternative: slower because it parses the range on every call
version.SatisfiesNpm("^1.0.0", includeAllPrerelease: true)
Outputs:
Range: 1.*
Prerelease range: *-* 1.*
Range includes version 1.1.0-rc.1+e471d15: False
Prerelease range includes version 1.1.0-rc.1+e471d15: True
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard1.1 netstandard1.2 netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1 |
.NET Framework | net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen30 tizen40 tizen60 |
Universal Windows Platform | uap uap10.0 |
Windows Phone | wpa81 |
Windows Store | netcore netcore45 netcore451 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETFramework 4.5.2
- No dependencies.
-
.NETStandard 1.1
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 2.0
- No dependencies.
NuGet packages (61)
Showing the top 5 NuGet packages that depend on Semver:
Package | Downloads |
---|---|
UmbracoCms.Core
Contains the core assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET project. |
|
Apprio.Enablement.Platform
Package Description |
|
Pulumi
The Pulumi .NET SDK lets you write cloud programs in C#, F#, and VB.NET. |
|
Apprio.Enablement.Telemetry.Exceptions
Package Description |
|
Cake.SemVer
Cake Build addon to provide Semantice Versioning classes and aliases. |
GitHub repositories (26)
Showing the top 5 popular GitHub repositories that depend on Semver:
Repository | Stars |
---|---|
dotnet/tye
Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
|
|
WolvenKit/WolvenKit
Community Mod editor/creator for REDengine games.
|
|
spectresystems/jarvis
Your robotic butler.
|
|
bilal-fazlani/commanddotnet
A modern framework for building modern CLI apps
|
|
aspose-words/Aspose.Words-for-.NET
Aspose.Words for .NET examples, plugins and showcases
|
Version | Downloads | Last updated |
---|---|---|
2.3.0 | 60,205 | 2/21/2023 |
2.3.0-beta.0 | 1,058 | 12/28/2022 |
2.3.0-alpha.0 | 4,559 | 7/17/2022 |
2.2.0 | 894,971 | 6/12/2022 |
2.2.0-rc.0 | 896 | 5/15/2022 |
2.1.0 | 1,213,405 | 3/19/2022 |
2.1.0-rc.1 | 187 | 3/19/2022 |
2.1.0-rc.0 | 426 | 3/7/2022 |
2.0.6 | 5,110,831 | 12/28/2019 |
2.0.5 | 225,142 | 10/27/2019 |
2.0.4 | 2,608,220 | 8/1/2016 |
2.0.3 | 4,351 | 7/31/2016 |
1.1.2 | 2,595,921 | 5/13/2014 |
1.1.1 | 3,015 | 11/24/2013 |
1.1.0 | 1,506 | 11/15/2013 |
1.0.5 | 1,931 | 7/1/2013 |
1.0.4 | 1,613 | 7/1/2013 |
1.0.3 | 1,841 | 1/10/2013 |
1.0.1 | 1,515 | 1/10/2013 |
1.0.0 | 1,876 | 1/9/2013 |