Windows PE (portable executable) files contain metadata that appear in the file's Properties dialog under the Details tab. It appears that arbitrary metadata can appear there.
What I'd like to do is add a piece of metadata to a C# class library that I build whose value is the commit id from the git repo HEAD the project was built from. I can't just use the CLR AssemblyVersionAttribute
to set the git commit id because the CLR requires that that show up in the standard a.b.c.d
version format. Besides, I'd ideally like to keep the user-meaningful version number there, but always have a way to look up, given the actual PE file, the commit id that could recreate it.
If there's a managed API to do it, so much the better, but I'm willing to P/Invoke to get this done.