title: Windows service, can't access app.config from within my Installer's constructor
body: <p>I want to store the username/password information of my windows service 'logon as' user in the app.config.</p>
  
  <p>So in my Installer, I am trying to grab the username/password from app.config and set the property but I am getting an error when trying to install the service.</p>
  
  <p>It works fine if I hard code the username/password, and fails when I try and access the app.config</p>
  
  <pre><code>public class Blah : Installer
  {
  
      public Blah()
      {
  
          ServiceProcessInstaller oServiceProcessInstaller = new ServiceProcessInstaller();
                  ServiceInstaller oServiceInstaller = new ServiceInstaller();            
  
                  oServiceProcessInstaller.Account = ServiceAccount.User;
  
          oServiceProcessInstaller.Username =             ConfigurationManager.AppSettings["ServiceProcessUsername"].ToString();
  
      }
  }
  </code></pre>