For Programmers: Free Programming Magazines  


Home > Archive > C# > March 2004 > Services Start up Order









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Services Start up Order
Dinesh Eswaran

2004-03-28, 10:28 pm

Hi,

I need to make sure that my windows service (written using C#/.NET
classes) starts up *AFTER* IIS.

How can I go about doing this?

Thanks
Dinesh
noah

2004-03-28, 10:28 pm

Hi,
The main way to do this is with the ServicesDependedOn property of
either the serviceInstaller or serviceController. If you do a search
on "ServicesDependedOn property" in the MSDN library, there's a great
example of exactly what you're looking for. I'm pretty sure that your
service will still start, but only after IIS.

Another option if you *need* more fine grained control of your
service (i.e. it can start, but not send requests to IIS) would be to
create a new System.ServiceProcess.ServiceController("IIS Service Name
goes here") and then monitor it (i.e. check status) before the section
that interacts with IIS.

Hope this helps,
Noah



> Hi,
>
> I need to make sure that my windows service (written using C#/.NET
> classes) starts up *AFTER* IIS.
>
> How can I go about doing this?
>
> Thanks
> Dinesh

Dinesh Eswaran

2004-03-28, 10:28 pm

"James P" <james-no-spam-no-reply@poovathummoottil.com> wrote in message news:<c28aij$bvg$1@news01.intel.com>...[color=darkred]
> Set the ServiceInstaller.ServicesDependedOn of your service installer.
>
> James
> "Dinesh Eswaran" <dinesh336@hotmail.com> wrote in message
> news:727ca83c.0403040720.716bb0ff@posting.google.com...


Thanks all for the help! It works fine. I have one more question
though - can I say
"Try to start the dependencies, but if they dont start its fine, you
start up anyway"

Basically I also want to try and start up mySQL service, but even if
there is no mySQL service installed, my service should start up
anyway.

Appreciate any inputs

Dinesh
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com