Wish: Column for .net AssemblyVersion

Discussion related to "Everything" 1.5.
Post Reply
Vorlon
Posts: 8
Joined: Wed Jul 12, 2017 9:22 pm

Wish: Column for .net AssemblyVersion

Post by Vorlon »

Hello!

I can see the File version and product version columns but I'd also like to see the "Assembly Version" of .net compiled files since it can be different.

In powershell you can get to it like this:
[System.Reflection.AssemblyName]::GetAssemblyName('C:\Path\To\Your.dll').Version

AssemblyVersion lives in the assembly manifest, not in the standard file‐version resource that Windows’ Property System exposes.

Cheating, ChatGPT says "From native C++, the cleanest way to read a .NET assembly’s AssemblyVersion (the four-part CLR identity) is to use the unmanaged metadata COM APIs—specifically, create an IMetaDataDispenser (via CLSID_CorMetaDataDispenser), open the target PE file with OpenScope, QueryInterface for IMetaDataAssemblyImport, and call GetAssemblyProps, which returns an ASSEMBLYMETADATA struct containing usMajorVersion, usMinorVersion, usBuildNumber, and usRevisionNumber. This path is fast, doesn’t load or execute the CLR, and works for any CLI-compliant assembly (Framework, Core, or .NET 5+)"
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Wish: Column for .net AssemblyVersion

Post by void »

I have put on my TODO list: add a "Assembly Version" property on my TODO list.

Thank you for your suggestion.
Post Reply