For a Service, the working directory is the Windows directory, you must
manually change it...
Try to add this in the OnStart() method (on in the Service CTOR):
// Define working directory (For a service, this is set to System)
Process pc = Process.GetCurrentProcess();
Directory.SetCurrentDirectory
(pc.MainModule.FileName.Substring(0,pc.MainModule. FileName.LastIndexOf(@"\")));
- José
"scott" <zx******@gmail.coma écrit dans le message de news:
11**********************@h48g2000cwc.googlegroups. com...
>I create a service project and build into service.exe , intall it as
system service. With a service.exe.config file in the directory as
service.exe. so that I can not start service.
I use vs2005 and windows xp
thx!