Error message when service fails to start  
Author Message
SeanPfent





PostPosted: Fri Apr 20 07:20:03 CDT 2007 Top

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

thx
Christof

DotNet59  
 
 
pbromberg





PostPosted: Fri Apr 20 07:20:03 CDT 2007 Top

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

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net






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