Retrieve version of another assembly

  • Thread starter Thread starter Marty
  • Start date Start date
M

Marty

Hi,

How can I retrieve the file version of another file outside my current
assembly?

Thank you!
Marty
 
Hi,

Do you mean assembly version?

Don;t know of a way to externally do this, you can load the assembly and
using Assembly.GetName().Version to get it, the problem is that now you have
loaded the assembly.

maybe a workaround would be to load it in another appdomain and unload it
when done.


cheers,
 
Something like the following will give you the file version:

FileVersionInfo info =
FileVersionInfo.GetVersionInfo(@"C:\WINDOWS\system32\notepad.exe");
Console.WriteLine("File version:{0}", info.FileVersion);
Console.Read();

-Nick Parker
 
Thank you guys for your fast reply.

Nick: This is what I was looking for, thanks.

Have a nice day!
Marty
 
Back
Top