A transparent MSBuild and .NET package that provides Git and Semantic Versioning information for C#, F#, and VB projects.
GitInfo is a NuGet package for .NET developers that automatically injects Git repository information and semantic versioning into MSBuild projects. It provides compile-time constants and build properties for details like commit hash, branch name, and version numbers, eliminating the need for external CI scripts to generate versioning metadata.
.NET developers using C#, F#, or VB who want to automate versioning and embed Git information directly into their assemblies without relying on custom build tasks or CI-specific tooling.
GitInfo offers a completely transparent, no-compiled-code approach that integrates seamlessly with MSBuild and generates easy-to-use constants, giving developers full control over versioning with minimal configuration and no external dependencies.
Git and SemVer Info from MSBuild, C# and VB
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses plain MSBuild targets and source generation without any compiled code, making the build process fully inspectable and debuggable, as emphasized in the README's philosophy of simplicity.
Automatically sets Version and PackageVersion using a SemVer-compatible format derived from Git history, reducing manual configuration and ensuring consistent versioning across local and CI builds.
Generates a ThisAssembly.Git static class with constants for C#, F#, and VB code, plus exposes MSBuild properties like $(GitBranch), providing flexibility for both runtime and build-time use.
Implements proper input/output caching to avoid unnecessary Git queries, maintaining build performance as highlighted in the README's incremental build-friendly feature.
GitInfo properties are only available within MSBuild targets that depend on its targets, not in top-level PropertyGroups, which complicates custom versioning setups and requires deeper MSBuild knowledge.
Requires payment of an Open Source Maintenance Fee for revenue-generating users, adding a cost barrier not present in many free alternatives, as detailed in the README's OSMF section.
Relies on Git being installed and accessible during builds, and may require additional configuration for CI environments, such as setting properties like GitBranchCI, which can be a hurdle in restricted setups.