MSBuild.Version.Target
4.0.153
Requires NuGet 2.5 or higher.
dotnet add package MSBuild.Version.Target --version 4.0.153
NuGet\Install-Package MSBuild.Version.Target -Version 4.0.153
<PackageReference Include="MSBuild.Version.Target" Version="4.0.153" />
<PackageVersion Include="MSBuild.Version.Target" Version="4.0.153" />
<PackageReference Include="MSBuild.Version.Target" />
paket add MSBuild.Version.Target --version 4.0.153
#r "nuget: MSBuild.Version.Target, 4.0.153"
#:package MSBuild.Version.Target@4.0.153
#addin nuget:?package=MSBuild.Version.Target&version=4.0.153
#tool nuget:?package=MSBuild.Version.Target&version=4.0.153
MSBuild.Version.Target
π―βοΈ MSBuild.Version.Target is a NuGet package that automates versioning by auto-incrementing the build version for non-release configuration builds.
It integrates seamlessly with your project by:
- Generating and maintaining a
Version.txtfile for versioning in Semantic Versioning (SemVer) format. - Automatically updating
AssemblyInfo.csandVersion.txtwith the incremented version during each build (except for theReleaseconfiguration).
π Features
- Semantic Versioning (SemVer) support:
- Major and minor versions are manually maintained.
- Build (patch) version is automatically incremented during the build process.
- Configurable via MSBuild.
- Works in CI/CD pipelines or local builds.
π¦ Installation
To install the NuGet package, use the following command:
Install-Package MSBuild.Version.Target
Or visit the NuGet package page for more details.
π οΈ Usage Instructions
Post-installation Setup:
After installing the package, locate theVersion.txtfile in the Properties folder of your project. Update the file with your current project version in the SemVer format:Major.Minor.Patch- Major and Minor: Managed manually.
- Patch: Automatically incremented for non-
Releasebuilds.
Configuration Management:
The versioning logic activates during any build configuration other thanRelease. Ensure the appropriate configuration is selected:- In Visual Studio, adjust this under Build > Configuration Manager.
- In CI pipelines or manual builds, specify the configuration explicitly using:
MSBuild /p:Configuration=Debug
Build Process:
During the build, the following updates occur automatically:AssemblyInfo.cs: The assembly version is updated to reflect the new version.Version.txt: The build version is incremented.
π Example
Hereβs a quick example of how the versioning would work:
- Initial
Version.txt:1.0.0 - After a build with configuration
Debug:1.0.1 - After another
Debugbuild:1.0.2 - Build with configuration
Release:- Version remains unchanged.
π§© Contributing
Contributions are welcome!
Feel free to open issues, submit pull requests, or suggest features.
π License
This project is licensed under the MIT License.
Learn more about Target Frameworks and .NET Standard.
-
- MSBuildTasks (>= 1.5.0.235)
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 |
|---|---|---|
| 4.0.153 | 117 | 3/23/2026 |
| 4.0.150 | 2,951 | 11/17/2024 |
| 4.0.147 | 461 | 11/17/2024 |
| 4.0.141 | 407 | 11/17/2024 |
| 4.0.138 | 411 | 11/16/2024 |
| 4.0.135 | 420 | 11/16/2024 |
| 4.0.130 | 406 | 11/16/2024 |
| 4.0.123 | 420 | 11/16/2024 |
| 4.0.120 | 404 | 11/16/2024 |
| 4.0.117 | 426 | 11/16/2024 |
| 4.0.114 | 531 | 10/28/2024 |
| 4.0.111 | 841 | 9/2/2024 |
| 4.0.105 | 453 | 8/27/2024 |
| 4.0.100 | 474 | 8/26/2024 |
| 4.0.84 | 2,126 | 6/19/2024 |
| 4.0.83 | 6,003 | 4/22/2024 |
| 4.0.71 | 2,123 | 12/14/2023 |
| 4.0.65 | 2,176 | 11/9/2023 |
| 4.0.60 | 943 | 9/23/2023 |
| 4.0.55 | 590 | 9/23/2023 |