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

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

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

unit testing - How to mock PreferenceManager in Android? -