How do I find out the referenced DLL's version?
-
Hello, I need to check the version of DLL library that I'm using in my program. How do I do that at runtime? Thanks much for any input. Michal Kreslik
-
Hello, I need to check the version of DLL library that I'm using in my program. How do I do that at runtime? Thanks much for any input. Michal Kreslik
hi Michal, i don't know exactly but i hope this information is going to help u. just paste this link on ur browser and c: www.codeproject.com/system/library_version.asp Regards, Rahithi
-
hi Michal, i don't know exactly but i hope this information is going to help u. just paste this link on ur browser and c: www.codeproject.com/system/library_version.asp Regards, Rahithi
Thanks, Rahithi, but the article at your link deals with C++ code. Do you know about any C# example? Thanks, Michal
-
Thanks, Rahithi, but the article at your link deals with C++ code. Do you know about any C# example? Thanks, Michal
Michal, sorry for sending the wrong article. as per my knowledge(i am new to .Net) If it's a managed assembly you're loading, you can check System.Reflection.Assembly.GetName().Version. and For native DLLs you can use the FileVersionInfo class. hope this will help regards, Rahithi
-
Michal, sorry for sending the wrong article. as per my knowledge(i am new to .Net) If it's a managed assembly you're loading, you can check System.Reflection.Assembly.GetName().Version. and For native DLLs you can use the FileVersionInfo class. hope this will help regards, Rahithi
Rahithi, thanks. It's a COM library I'm referencing, so I can't use the System.Reflection namespace directly I guess. But maybe I could use the System.Reflection namespace to get the external DLL's version by using a non-static method System.Reflection.Assembly.GetModule().ModuleVersionId. But I have yet to find out how to do that. Unfortunately, getting the fileversion information thru FileVersionInfo.GetVersionInfo() doesn't work neither since it keeps returning "1.0.0.0" for a DLL that has a Runtime version of "v2.0.50727". What am I trying to accomplish here is to get the information that's visible in the Properties tab under "Runtime Version" if you click on the appropriate library in the References solution folder. Any idea? Thanks, Michal Kreslik