Assembly version from command line?

Patrice Pezillier picture Patrice Pezillier · Jun 14, 2010 · Viewed 45.6k times · Source

Is there a Microsoft tool to get the assembly version of a DLL file from a command line?

(I know that I can code my own tool.)

Answer

OregonGhost picture OregonGhost · Jun 14, 2010

This is an area where PowerShell shines. If you don't already have it, install it. It's preinstalled with Windows 7.

Running this command line:

[System.Reflection.Assembly]::LoadFrom("C:\full\path\to\YourDllName.dll").GetName().Version

outputs this:

Major  Minor  Build  Revision
-----  -----  -----  --------
3      0      8      0

Note that LoadFrom returns an assembly object, so you can do pretty much anything you like. No need to write a program.