title: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security
body: <p>I am trying to create a Windows Service, but when I try and install it, it rolls back giving me this error:</p>
  
  <blockquote>
    <p>System.Security.SecurityException: The
    source was not found, but some or all
    event logs could not be searched.
    Inaccessible logs: Security.</p>
  </blockquote>
  
  <p>I don't know what this means - my application has the bare minimum since I am just testing things out first.</p>
  
  <p>My Installer Code:</p>
  
  <pre><code>namespace WindowsService1
  {
      [RunInstaller(true)]
      public partial class ProjectInstaller : System.Configuration.Install.Installer
      {
          public ProjectInstaller()
          {
              //set the privileges
              processInstaller.Account = ServiceAccount.LocalSystem;
              processInstaller.Username = null;
              processInstaller.Password = null;
  
              serviceInstaller.DisplayName = "My Service";
              serviceInstaller.StartType = ServiceStartMode.Manual;
  
              //must be the same as what was set in Program's constructor
              serviceInstaller.ServiceName = "My Service";
  
              this.Installers.Add(processInstaller);
              this.Installers.Add(serviceInstaller);
          }
  
          private void serviceProcessInstaller1_AfterInstall(object sender, InstallEventArgs e)
          {
          }
  
          private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
          {
          }
      }
  }
  </code></pre>
  
  <p>My Service Code:</p>
  
  <pre><code>public partial class Service1 : ServiceBase
  {
      public Service1()
      {
          this.ServiceName = "My Service";
      }
  
      protected override void OnStart(string[] args)
      {
          base.OnStart(args);
      }
  
      protected override void OnStop()
      {
          base.OnStop();
      }
  }
  </code></pre>