title: Why is my custom Windows service not doing its work?
body: <p>I have created a service which would show "Hello World" message when it starts..
  The OnStart method of the service consists the following code:</p>
  
  <pre><code>protected override void OnStart(string[] args)
  {
      System.Windows.Forms.MessageBox.Show("Hello World");
  }
  </code></pre>
  
  <p>The service is installed perfectly, but when I start the service I get the following error.</p>
  
  <blockquote>
    <p>The RucService on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the performance Logs and Alert service.</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/g3fM2.jpg" alt="Error Message"></p>
  
  <p>So it does not show the message Hello World. Why is this happening?</p>