How to set .Net service dependencies

  • Thread starter Thread starter Usman
  • Start date Start date
U

Usman

Hi

I've created a windows service in .Net and want it to be dependant on some
other service. Can someone please tell how to do it programatically instead
of editing the registry. Just like earlier in VC++ there was a parameter
passed to "CreateService" that would specify the service dependencies. I
didnt see any option in .Net service. Please help if there's any solution
other then writing it in registry.

Regards

Usman
 
Hello, Usman!

U> I've created a windows service in .Net and want it to be dependant on
U> some other service. Can someone please tell how to do it programatically
U> instead of editing the registry. Just like earlier in VC++ there was a
U> parameter passed to "CreateService" that would specify the service
U> dependencies. I didnt see any option in .Net service. Please help if
U> there's any solution other then writing it in registry.

How do you install your service?

If you do this via ServiceInstaller class and InstallUtil, then in the installer class there is property that will help you ( ServicesDependedOn ).

If you install service via ServiceInstall table in the MSI, then you must add values into Dependencies column.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Back
Top