How can I get the application's startup path from the dll

ajeeshco

Well-known member
Joined
Sep 19, 2006
Messages
257
Location
Cochin, India
Programming Experience
3-5
Hi,
How can I get the application's startup path from the dll that i used along with the application.
the dll is seperated in another folder.

Thanks in advance
 
Did you try: Application.StartupPath

Edit: If you haven't referenced and imported the namespace System.Windows.Forms that Application class belong to you must Add Reference to System.Windows.Forms.dll and fully qualify this shared property to use it. (System.Windows.Forms.Application.StartupPath)

Alternative is to use: System.AppDomain.CurrentDomain.BaseDirectory
 
I think he is talking about getting the assembly that is calling the code, in which case it would be..

VB.NET:
System.Reflection.Assembly.GetCallingAssembly.Location
 
Back
Top