How to get the path of the application being run?

  • Thread starter Thread starter K Viltersten
  • Start date Start date
K

K Viltersten

I have a service that create an instance of
a class Donkey that is compiled to an EXE
at the location c:\animals.

Since i run the thing as a service, i get
the working directory to be
c:\windows\system32
but i'd need to know what directory the
class is located in. That's where i'll have
my config files, namely.
 
I have a service that create an instance of
a class Donkey that is compiled to an EXE
at the location c:\animals.

Since i run the thing as a service, i get
the working directory to be
  c:\windows\system32
but i'd need to know what directory the
class is located in. That's where i'll have
my config files, namely.

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.

Assembly.GetExecutingAssembly().Location should solve it..

-Cnu
 
Back
Top