title: How to catch exception and stop Topshelf service?
body: <p>I have a topshelf windows service where I want to do some checking (i.e. if an xml file exists) and if the check fails I need the windows service to stop.</p>
  
  <p>So I tried doing the check in the Start() method and then raise an exception:</p>
  
  <pre><code>public void Start()
  {
      if (!File.Exists(_xmlFile) throw new FileNotFoundException();
      // Do some work here if xml file exists.
  }
  </code></pre>
  
  <p>However, the windows service stays around as a process after the exception which I then have to kill manually in the task manager.</p>
  
  <p>Is there a way to not run the service if certain conditions (i.e. file not found) hold?</p>