I was writing some code into To-Do
My initial thought was : on startup i will launch git and try to get some information about branch and commit hash and then incorporate that into the configuration system and then show that in the footer…
Well, that sounded complicated and so it probably was… after a few seconds, I found this great Nuget called GitInfo that basically creates a partial class at build time that can be referred to in code, my startup code now looks like this :
public string GitVersion { get => string.Format($"V{ThisAssembly.Git.BaseVersion.Major}.{ThisAssembly.Git.BaseVersion.Minor}.{ThisAssembly.Git.BaseVersion.Patch} T={ThisAssembly.Git.Tag} {ThisAssembly.Git.Branch}[{ThisAssembly.Git.Commit}] {{0}}", ThisAssembly.Git.IsDirty?"Dirty":""); } ... Configure() { ... Configuration["GitVersion"] = GitVersion; ... }