I’m not very experienced in this area – so I’ve got a few questions. Firstly, do all .Net created DLLs have their own GUID? If not, my question is how do I get one and associate it with the DLL.
Then the question is, how do I get the GUID of that dll – ie. given a DLL path (c:\some\path\to\a\file.dll) how do I determine its GUID? Also, is there an easy way to go the other way (GUID -> DLL) – I’ve read a bit about this but a lot of it refers to VB6 DLLs and COM stuff…does this still apply to .Net DLLs?
Update: Thanks for the answers. Maybe I’m asking the wrong question. I want to have a unique ID for each of my DLL files, so that I can reference them in a database. I want to be able to take the unique ID stored in the database, and then easily find the DLL and do some stuff with it. From what the answers have said maybe I shouldn’t be using a GUID, is there a .Net way to do this then?
To answer the second question (Guid -> assembly) this is simple if the dll is already loaded and you just want to find which one had a guid (if any) you can simply do
If you want to do it without it being loaded you would either need to load it into a temporary app domain, check it, then drop the app domain or use the unmanaged introspection api to do the same thing but with no need to release anything after.