title: No overload for matches delegate 'System.Timers.ElapsedEventHandler'
body: <p>I was reading this article: <a href="http://www.c-sharpcorner.com/UploadFile/naresh.avari/develop-and-install-a-windows-service-in-C-Sharp/" rel="nofollow">http://www.c-sharpcorner.com/UploadFile/naresh.avari/develop-and-install-a-windows-service-in-C-Sharp/</a>
  So playing with the windows services I encountered a little problem due to my lack of knowledge. In this part of the code:</p>
  
  <pre><code> protected override void OnStart(string[] args)
      {
          timer1 = new Timer();
          this.timer1.Interval = 10800; 
          this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Tick);
          timer1.Enabled = true;
      }
  
      private void timer1_Tick()
      {
         //some code here
      }
  
      protected override void OnStop()
      {
          timer1.Enabled = false;
        //some code here
  
      }
  </code></pre>
  
  <p>The             <code>this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Tick);</code>
  gives: </p>
  
  <blockquote>
    <p>Error 1   No overload for 'timer1_Tick' matches delegate
    'System.Timers.ElapsedEventHandler'</p>
  </blockquote>
  
  <p>I wonder why since many people don't have a problem with that example?</p>