Steven Giesel 2/22/2023

Getting git version information in your C# code

Read Original

This technical article explains how to use the GitInfo library, a source generator for C#, to automatically embed Git metadata (such as commit hash, latest tag, and semantic version) as compile-time constants. It demonstrates accessing this information via a generated `ThisAssembly.Git` object, discusses the build-time impact, and highlights benefits like not shipping a separate dependency.

Getting git version information in your C# code

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week