title: Error "Could not find xxxx.Program specified for main method" creating Windows Service from MS example
body: <p>I am following <a href="http://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx" rel="nofollow noreferrer">this Microsoft guide to create a windows service</a>.</p>
  <p>However when I try and build it on the auto generated page called &quot;Program.cs&quot;
  That has this code in it</p>
  <pre><code>namespace BetfairBOTV2Service
  {
      static class Program
      {
          /// &lt;summary&gt;
          /// The main entry point for the application.
          /// &lt;/summary&gt;
          static void Main()
          {
              ServiceBase[] ServicesToRun;
              ServicesToRun = new ServiceBase[] 
              { 
                  new BrainiacVersion2() // not green though!!!!!
              };
              ServiceBase.Run(ServicesToRun);
          }
      }
  }
  </code></pre>
  <p>I get this error &quot;Could not find BrainiacV2.Program&quot; specified for Main Method</p>
  <p>I did everything the tutorial told me to.</p>
  <p>I have an App.Config, a Program.cs (code above), a BrainiacV2.cs which holds all my code for the service and starts like this</p>
  <pre><code>namespace BetfairBOTV2Service
  {
      public partial class BrainiacV2 : ServiceBase
      {
          public BrainiacV2()
          {
              InitializeComponent();
  </code></pre>
  <p>My ProjectInstaller.cs with two installer objects on them
  (name) serviceInstaller
  Display Name: My new BetfairBotV2
  ServiceName: BrainiacVersion2</p>
  <p>And that is that.</p>
  <p>This is the only error I am getting</p>
  <p>The solution is called BrainiacV2</p>
  <p>I have tried changing the code in Program.cs to</p>
  <p>new BrainiacV2()</p>
  <p>which turns it green but then I just get</p>
  <p>Could not find BrainiacV2.Program specified for main method.</p>
  <p>What am I doing wrong or need to change?</p>
  <p>Any help would be much appreciated - thanks!</p>
  <p>Win 7, 64 bit, .NET 4.5, C#</p>