Visual C#.Net >> Error message when service fails to start
Hi,
the Service I wrote in C# may fail to start for some reason. I can report
that failure to the SMC resp. to the net start command by setting ExitCode
to a non zero value and then throw an Exception.
The problem is that it either reports a predefined message or simply the
number with no text meaningfull to the user. Is there anyway I can set the
error message reported?
Atleast it should be a message like : "Look in the Event-Log for further
information".
Visual C#.Net >> Error message when service fails to start
When you throw the exception, write a custom message to the event log just
before doing so.
Alternatively, if you've wired in an unhandled exception event handler, you
ca also do it there.
Peter
> Hi,
>
> the Service I wrote in C# may fail to start for some reason. I can report
> that failure to the SMC resp. to the net start command by setting ExitCode
> to a non zero value and then throw an Exception.
>
> The problem is that it either reports a predefined message or simply the
> number with no text meaningfull to the user. Is there anyway I can set the
> error message reported?
>
> Atleast it should be a message like : "Look in the Event-Log for further
> information".
>
> thx
> Christof
>
>
>