c# - Get Version from Non Executing Executable File -


i know how version of executing application or dll. need find properties of non executing application.

i have small program set file association main application. there no point in users of old versions running since application not accept arguments on start up. when file associator starts first checks see if can find main app. if can want check properties without executing it. if version earlier 1 can accept arguments want tell user update rather proceed set association.

i have looked @ system.io.fileinfo not seem include version information.

thanks

you can use fileversioninfo.getversioninfo():

fileversioninfo vi = fileversioninfo.getversioninfo("myfile.dll"); 

string showversion = vi.fileversion;

//showversion actual version no.

this returns file/document metadata , can used unmanaged dlls or word documents well.

you can use assembly:

version v = assembly.reflectiononlyloadfrom("myfile.dll").getname().version; 

this contain .net version information.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -