By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,248 Members | 882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,248 IT Pros & Developers. It's quick & easy.

Error message when service fails to start

P: n/a
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
Apr 20 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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


"Christof Nordiek" wrote:
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
Apr 20 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.