Getting the path for a running DLL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I was wondering how to get the path that a DLL is running from (from a method within that DLL, e.g. it's own install path))? I have a web app with two modules. I'd like one of them to be able to read a file from the web app's bin directory (where the DLL is running from), but I can't find any information about how to get the path. The current folder returns the system32 folder, not the bin folder.

Thanks for your help.
 
Regular DLL can get it's full path by calling GetModuleFileName
Not sure that this will work with .NET dll.

George.

Craig said:
Hi

I was wondering how to get the path that a DLL is running from (from a
method within that DLL, e.g. it's own install path))? I have a web app with
two modules. I'd like one of them to be able to read a file from the web
app's bin directory (where the DLL is running from), but I can't find any
information about how to get the path. The current folder returns the
system32 folder, not the bin folder.
 
Back
Top