Getting the path for a running DLL

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.
 
G

George Ter-Saakov

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top