This project demonstrates a workaround to enable GitVersion.MsBuild 6.x integration for projects running in the Visual Studio IDE.
GitVersion automates semantic versioning based on your Git history. This sample shows how to configure your .csproj and use the generated version information in your application.
- The project uses the
GitVersion.MsBuildNuGet package. - The
.csprojfile includes a custom MSBuild target (GetVersionForVisualStudio) to generate version info usingdotnet gitversion. - Version metadata is injected into the assembly and accessed at runtime.
GitVersionTest.csproj: MSBuild configuration and GitVersion integration.Program.cs: Example code showing how to read GitVersion metadata from the assembly at runtime.