c# - Handle exception on service startup -


i'm writing series of windows services. want them fail if errors thrown during startup (in onstart() method). had assumed merely throwing error in onstart() this, i'm finding instead "starts" , presents me message stating "the service has started, inactive. correct?" (paraphrase). how handle error fails start service?

if running .net 2.0 or higher, can use servicebase.stop stop service onstart. otherwise call stop new thread.

ref [devnewsgroups] (http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic50404.aspx)

(news group gone)


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -