application path of a service

  • Thread starter Thread starter Dmitry Akselrod
  • Start date Start date
D

Dmitry Akselrod

Hello everyone,

This is probably a very simple and stupid question, but I cannot seem to
find the answer to it. How do I obtain the path of a windows service's
executable file? The Application.StartupPath does not work of course, since
the system.windows.forms assembly is not loaded. I tried
Environment.CurrentDirectory and System.IO.Directory.GetCurrentDirectory,
but they echoed the system32 directory.

Thanx,

Dmitry
 
Hello,

Dmitry Akselrod said:
This is probably a very simple and stupid question, but
I cannot seem to find the answer to it. How do I obtain
the path of a windows service's executable file?

Maybe 'System.Reflection.Assembly.GetExecutingAssembly().Location' works
(untested).
 
Back
Top