c# windows service install,dependency and debug

  • Thread starter Thread starter want 2 Learn
  • Start date Start date
W

want 2 Learn

Guest
I used the next template for windows service

windows-service-template

I try to :

1. check if my dependency services exist.

2. to add the dependencies to my service

3. to debug the install process when I make it from command line

protected override void OnBeforeInstall(IDictionary savedState)
{
base.OnBeforeInstall(savedState);
Debugger.Break();
serviceInstaller1.ServiceName = ServiceName;
serviceInstaller1.DisplayName = DisplayName;
serviceInstaller1.Description = Description;
// serviceInstaller1.ServicesDependedOn = new string[] { config.ServicesDependedOn.split(",") };
//this.Installers.Add(serviceInstaller1);
}

the lines that on comment make the installation process to fail.

1. what is the way to check for dependency exist? (if not I want to stop the process)

2. how to add dependency correctly?

3. how can I debug the windows service install process?


Thanks

Continue reading...
 
Back
Top