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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top