Environment.Exit in Win services

  • Thread starter Thread starter Freaky
  • Start date Start date
F

Freaky

Hi,

My exe file will start 4 different services. If the code encounters an
Environment.Exit() while in execution, i see that, all the 4 services
are stopped(crashed). But i want that particular service alone to stop.

What can i do for this?..


PLZ reply ASAP.

thx in adv.


Freaky
 
Will it just start or does it also implement those services ?

Environment.Exit ends the EXE so it's likely expected that it will end all
services it would implement in an unexpected manner...

I would try instead do call the Stop method of the service you want to stop
(possibly usign a ServiceController).
 
Back
Top