Adeptik Semantic Version support for C# projects.
To install the version in .NET Core, you can use the following code in the csproj project:
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>preview-label</VersionSuffix>
<SourceRevisionId>dev</SourceRevisionId>
</PropertyGroup>
The properties here are:
- VersionPrefix - leftmost part of the version,
- VersionSuffix - pre-release label if any,
- SourceRevisionId - build metadata.
The result version is 1.0.0-preview-label+dev
.
You can read more about version in .NET Core projects in Andrew Lock's blog: Version vs VersionSuffix vs PackageVersion: What do they all mean?.
Assembly's product version must comply with Semantic Versioning 2.0.0.
To verify this requirement, you must install the package
Install-Package Adeptik.SemanticVersion
In your csproj file set
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>preview-label</VersionSuffix>
</PropertyGroup>
By default, the value of the SourceRevisionId
property is set to "developer.build"
.
The package validates that Version
property is wellformed.
To disable Version
validation you can add the following property to your csproj
<PropertyGroup>
<ValidateSemanticVersion>false</ValidateSemanticVersion>
</PropertyGroup>