C# .NET 2.0
I've got a Windows Service that works exactly as I expect it to. However,
it does rely on a few Configuration settings. If the customer doesn't
configure it correctly, the service shouldn't start.
So I've put in some try...catchs, but what I'm not sure how to do is not
allow the service to start. If attempted to start with the NET START
command, throwing an exception keeps the service from starting, but the
message reported back is :
The MyService service is starting.
The MyService service could not be started.
The service did not report an error.
So how do I report this error? Writing it to the EvenLog doesn't resolve
it, although there is an entry in there as expected.
Secondly, if the service is started via the SMC, the service doesn't start
as expected, but I'm given the following error:
The MyService service on Local Computer started and then stopped. Some
services stop automatically if they have no work to do, for example, the
Performance Logs and Alerts service.
So how do I prevent the service from starting (although in both these
cases, the service doesn't actually start) and make whatever appropriate
error reports necessary?
Thanx!
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/