Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting directory of dll
Message
De
25/03/2009 09:57:26
 
 
À
25/03/2009 09:40:26
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Application:
Desktop
Divers
Thread ID:
01391347
Message ID:
01391355
Vues:
38
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform