Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting directory of dll
Message
From
25/03/2009 09:57:26
 
 
To
25/03/2009 09:40:26
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Application:
Desktop
Miscellaneous
Thread ID:
01391347
Message ID:
01391355
Views:
37
>Hi All,
>
>I have a process in my application that I have moved out to a seperate dll. Some of the methods are operating on a directory under the using application directory. Is there a way for me to obtain the directory either where the dll exists or the directory of the application using the dll?
>
>I could pass it in from the application, but it seems like a detail the application shouldn't have to worry about.

Hi,
I *think* that calling System.Reflection.Assembly.GetExecutingAssembly().Location from within the DLL will give the location of the DLL.

AppDomain.CurrentDomain.BaseDirectory should give the location of the main EXE....

HTH,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform