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.
Further reading and information
RESTful API Design and Build Standards
Semantic Versioning 2.0.0 | Semantic Versioning
NuGet Package Version Reference | Microsoft Learn
Versioning and .NET libraries - .NET | Microsoft Learn
API Versioning Options · dotnet/aspnet-api-versioning Wiki
API versioning misconceptions: When you need it and when you don't | Google Cloud Blog
apigee-web-api- design-the-missing-link-ebook.pdf (page 56)
Breaking changes and .NET libraries - .NET | Microsoft Learn
Attributes interpreted by the compiler: Miscellaneous - C# reference | Microsoft Learn
https://github.com/dotnet/Nerdbank.GitVersioning
Versioning limitations in .NET | Jon Skeet's coding blog