Link to home
Start Free TrialLog in
Avatar of rcoast
rcoast

asked on

Locate DLL by GUID

I need C# code to locate the directory of a DLL by the GUID. In some cases it will be in under C:\Program Files\{myapp} but in other cases, C:\Program Files (x86)\{myapp}
ASKER CERTIFIED SOLUTION
Avatar of nsanga
nsanga

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rcoast
rcoast

ASKER

On my 64bit system the class is located at:

HKCR\Wow6432Node\CLSID\{GUID}\ImprocServer32\

This is not consistent with 32bit systems.

Do I have to check both, or insnt there an easier way?
As far as COM dlls are considered their details (like path) are stored in registry. You don't find the path any where else. So you should read the registry for them.

Also as it differs for 32bit and 64bit, you need to check it before you read it.

I am sure what the machine (32bit or 64) you are running will be available some where either from .net class library or from registry. But this is the only way you can get the dll path.

i can try to find a way to programatically know which machine you are running under if you want.
Avatar of rcoast

ASKER

I solved the problem by using Reflection, of another EXE running in the same folder... to get the location fo the assembly.