Michael

Michael

  • NA
  • 1
  • 0

Reading from app.config in a Service Installer class

Jan 22 2008 10:56 AM
Hi!
I created a new Windows Service in C# and want to set a Service Dependency.
Did it like this:

ServiceInstaller si = new ServiceInstaller();
si.ServicesDependedOn = new string[] { "DependingOnThisService" };
this.Installers.Add(si);

Everything works fine. My Problem right now is, that I want to set this Dependency only in fact of a special "flag" in the app.config - file.
But I am not able to read from the app.config - file in the ( from System.Configuration.Install.Installer inherited) class.

I neither get an exception nor a result from the config - file (always get an empty string).
So is there a possibility to read from the app.config in this class or, if not, what is the best alternative to do this?

Hope anybody can help me!
tia