tags:

views:

50

answers:

1

I need to bone up on my CLR compiling knowledge, so i'm going to speak in generalities... Appologies if I'm not being specific enough.

I'm working on an application that references a COM Library dll which has a number of dlls rolled into it. My question is, is it possible using Reflection to get a reference to the sub dll's assembly, namely to obtain the version number?

Or, if this question makes no sense, i'll try to rephrase.

+2  A: 

No can do, you've got no way to find out what DLLs the COM server might be using. There isn't anything like Assembly.GetReferencedAssemblies() in unmanaged code. Process.Modules is about as close as you can get but there's no way to find out that the module you'll iterate was actually associated with the server instead of being loaded by, for example, OpenFileDialog or some obscure virus scanner crap.

If you know the DLL names and where they are located then you can use the FileVersionInfo class to obtain their unmanaged version resource info.

Hans Passant
I do know the dll names, any chance you could offer up a small code sample?
priehl
There's a decent one in the MSDN Library article for the FileVersionInfo class
Hans Passant