Skip to content

Implement a versioning strategy

A versioning strategy MUST define how you assign, increment, and publish version numbers. It SHOULD integrate with your branching strategy to streamline builds and deployments.

Use semantic versioning

The Semantic Versioning (SemVer 2.0.0) specification is RECOMMENDED and MUST be used for public APIs and NuGet packages. SemVer makes it easier for consumers to understand breaking, additive, or patch-level changes.

Automate version numbering

Use tools like Nerdbank.GitVersioning to generate SemVer compliant versions during builds.

Practical tips

For .NET projects, NuGet 4.3.0+ supports SemVer 2.0.0.

For APIs, include version numbers only if updates are expected; omit them for static APIs.

For C# projects, use the obsolete attribute to warn about upcoming deprecations.

Don't confuse semantic versioning, which reflects technical compatibility, with product versions which often align with release schedules.