title: Windows Service installed. But start, stop buttons disabled
body: <p>I created windows service. Installed with Installutil.exe success, but when i press start button appears progress bar "starting", then it stopped at 50 percent. I have to cancel. After cancel service works perfect, but start, stop and pasue commands disabled. If i want to stop service, i have to uninstall service. What can be reason ?</p>
  
  <p>Main method:</p>
  
  <pre><code>static void Main()
      {
          ServiceBase[] ServicesToRun;
          ServicesToRun = new ServiceBase[] 
              { 
                  new TelegramBotService()
              };
          ServiceBase.Run(ServicesToRun);
      }
  </code></pre>
  
  <p>It is my service class: </p>
  
  <pre><code>partial class TelegramBotService : ServiceBase
  {
      private static Logger logger = LogManager.GetCurrentClassLogger();
      public TelegramBotService()
      {
          InitializeComponent();
      }
  
      protected override void OnStart(string[] args)
      {
          try
          {
              RunBot().Wait();
              logger.Info("Start windows service");
          }
          catch(Exception ex)
          {
              logger.Error(ex.Message);
          }
      }
  
      private async Task RunBot()
      {
          try
          {
  
            logger.Info("Start Telegram Bot");
            //var ElectionsBot = new ElectionsInfo();
            var ElectionsBot = new ElectionsCount();
            await ElectionsBot.Start();
          }
          catch(Exception ex)
          {
              logger.Error(ex.Message);
          }
      }
  
      protected override void OnStop()
      {
          logger.Info("Stop windows service");
      }
  }
  </code></pre>