title: How to make a .NET Windows Service start right after the installation?
body: <p>Besides the service.StartType = ServiceStartMode.Automatic my service does not start after installation</p>
  
  <p><strong>Solution</strong></p>
  
  <p>Inserted this code on my ProjectInstaller</p>
  
  <pre><code>protected override void OnAfterInstall(System.Collections.IDictionary savedState)
  {
      base.OnAfterInstall(savedState);
      using (var serviceController = new ServiceController(this.serviceInstaller1.ServiceName, Environment.MachineName))
          serviceController.Start();
  }
  </code></pre>
  
  <p>Thanks to ScottTx and Francis B.</p>