34

You can use the following to get the File Version:

FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo("filename.exe");

But how can you get the Assembly Version for a specific EXE file?

Marc
  • 9,012
  • 13
  • 57
  • 72
Keith Maurino
  • 3,374
  • 10
  • 40
  • 48
  • Take a look at this link and see if it answers your question http://stackoverflow.com/questions/187495/how-to-read-assembly-attributes – Captain Sensible Apr 27 '10 at 19:56

1 Answers1

62

From this blog article How to get assembly version without loading it:

AssemblyName.GetAssemblyName("filename.exe").Version

This avoids having to load the assembly in its entirity.

Justin
  • 84,773
  • 49
  • 224
  • 367
Daniel Renshaw
  • 33,729
  • 8
  • 75
  • 94
  • This allows to delete the assembly after that check, even if the application is still running. Great! – Jerther Jun 10 '15 at 20:00