Dll file version check


















A dll is registered using regsvr32 and i want to check if its registered or not! Yes its not GAC but its registry! My question is, it might be any dll In the same way, i will uninstall it. Now, I have to verify if that dll is unregistered or not. Please let me know! As an early warning. Like Sheng mentioned, the dll developer has full control over what happens when you call regsvr They can do whatever the heck they feel like doing, and there's no absolute way for you to tell whether they've done it or not.

Additionally, if this is a COM control and the dll developer ever tries to change the name of their dll, your function will need to be updated. This check makes your code dependent on some third party developer not changing their practices, which is never a safe place to be.

I think you may be asking the wrong question. Instead of trying to tell whether the dll has been registered, you should just be making sure the functionality you need is available.

You shouldn't care whether "xyz. The name, location, or method of installation of the file should not affect your program. Ask a question. Quick access. Search related threads. Remove From My Forums. Kris Kris This loads MyAssembly. I recommend Assemblyname. GetAssemblyName to avoid these issues — staafl. Are these reasons sound enough? GetVersionInfo "foo.

FileVersion does well the job and doesn't load the dll into the application. Show 3 more comments. First of all, there are two possible 'versions' that you might be interested in: Windows filesystem file version, applicable to all executable files Assembly build version, which is embedded in a.

GetAssembly typeof! Version; Just replace! Totero Totero 2, 17 17 silver badges 34 34 bronze badges. Note that this only works if the assembly in question is statically referenced by the current one. This is the best answer since the DLL is not necessarily the entry assembly not even the assembly this is called from — CAD bloke. See stackoverflow.

To get it for the assembly that was started winform, console app, etc GetExecutingAssembly might also help. GetExecutingAssembly work nice at asp. EndsWith ". Split '. MacSpudster MacSpudster 1 1 silver badge 5 5 bronze badges. ProductVersion This method met my expectations Update: Instead of explicitly mentioning dll path in program as needed in production version , we can get product version using Assembly. GetVersionInfo assembly.

Prasan Dutt Prasan Dutt 83 1 1 silver badge 9 9 bronze badges. Note: if version contains asterisk for auto-incremented value this method will return the asterisk instead of the actual generated number ie doesn't work if you put 1. However, I chose Jeniks automation for version upgrade so assembly is always having having perfect combination of dll version. FullName ;. BNL 7, 4 4 gold badges 25 25 silver badges 31 31 bronze badges. Invincible Invincible 3 3 silver badges 19 19 bronze badges.

You can use System. Ariel Ariel 5, 5 5 gold badges 43 43 silver badges 58 58 bronze badges. CreateResponse HttpStatusCode. GetAssembly typeof Class. File Version Info. File Version Property Reference Is this page helpful? Please rate your experience Yes No. Any additional feedback? Namespace: System. Diagnostics Assembly: System. Gets the file version number. In this article.



0コメント

  • 1000 / 1000