NetChris.BuildTools.Versioning
1.0.444414356
Prefix Reserved
See the version list below for details.
dotnet add package NetChris.BuildTools.Versioning --version 1.0.444414356
NuGet\Install-Package NetChris.BuildTools.Versioning -Version 1.0.444414356
<PackageReference Include="NetChris.BuildTools.Versioning" Version="1.0.444414356"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="NetChris.BuildTools.Versioning" Version="1.0.444414356" />
<PackageReference Include="NetChris.BuildTools.Versioning"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add NetChris.BuildTools.Versioning --version 1.0.444414356
#r "nuget: NetChris.BuildTools.Versioning, 1.0.444414356"
#:package NetChris.BuildTools.Versioning@1.0.444414356
#addin nuget:?package=NetChris.BuildTools.Versioning&version=1.0.444414356
#tool nuget:?package=NetChris.BuildTools.Versioning&version=1.0.444414356
NetChris.BuildTools.Versioning
Provides consistent versioning of assemblies and packages
Use
In your project's *.csproj file:
- Set
<VersionPrefix />to the{Major}.{Minor}version of your project - Add the reference:
dotnet add package NetChris.BuildTools.Versioning - Alternately, directly add the
PackageReferencein your project, replacing "0.0.*" with the most appropriate package version:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<VersionPrefix>0.2</VersionPrefix>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NetChris.BuildTools.Versioning" Version="0.0.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
This relies on this blurb from "Include MSBuild props and targets in a package":
You might want to add custom build targets or properties in projects that consume your package, such as running a custom tool or process during build. You do this by placing files in the form
<package_id>.targetsor<package_id>.props[...] within the\buildfolder of the project.
Variables during build
There are a few properties you can set to vary the versioning. These values can also be supplied through environment variables. They are primarily of use in CI/CD scenarios.
| Property | Use | Recommended source |
|---|---|---|
SemVerPatch |
The SemVer patch version. | Pipeline ID |
SemVerPrerelease |
The SemVer pre-release version, if any | Assuming Pipeline ID for the patch version, just a simple "prerelease" static string. |
AssemblyVersionBuild |
The build number to use for the assembly (and file) [version]https://docs.microsoft.com/en-us/dotnet/api/system.version) | Pipeline IID (i.e. project-specific pipeline ID) to keep ⇐ UInt16.MaxValue - 1 |
AssemblyVersionRevision |
The revision number to use for the assembly (and file) version | For now, hard-set to 0 |
References
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 1.0
- NETStandard.Library (>= 1.6.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.444415557 | 1,331 | 1/10/2022 |
| 1.0.444414356 | 727 | 1/10/2022 |
| 0.0.444355915-pre | 662 | 1/10/2022 |
| 0.0.444352211-pre | 736 | 1/10/2022 |