title: How do I change the name of my Windows service?
body: <p>I have a Windows Service and want to change the name of it (as it appears in the Services application). But I'm unsure of the correct way to do so. It appears to be the ServiceName property and searching through my solution I found this:</p>
  
  <pre><code>namespace SI.AService.AService
  {
      partial class AService
      {
          /// &lt;summary&gt; 
          /// Required designer variable.
          /// &lt;/summary&gt;
          private System.ComponentModel.IContainer components = null;
  
          /// &lt;summary&gt;
          /// Clean up any resources being used.
          /// &lt;/summary&gt;
          /// &lt;param name="disposing"&gt;true if managed resources should be disposed; otherwise, false.&lt;/param&gt;
          protected override void Dispose(bool disposing)
          {
              if (disposing &amp;&amp; (components != null))
              {
                  components.Dispose();
              }
              base.Dispose(disposing);
          }
  
          #region Component Designer generated code
  
          /// &lt;summary&gt; 
          /// Required method for Designer support - do not modify 
          /// the contents of this method with the code editor.
          /// &lt;/summary&gt;
          private void InitializeComponent()
          {
              // 
              // AService
              // 
              this.ServiceName = "Company.AService.AService";
  
          }
  
          #endregion
      }
  }
  </code></pre>
  
  <p>So this seems to be autogenerated code. What's the proper way of changing it? It says "do not modify the contents of this method with the code editor." So where do I modify it then?</p>
  
  <p><strong>Update:</strong> I was updating my Windows Service through the build process in Visual Studio, which apparently has no effect on name changes set up in the service installer. I think it runs an uninstall and install command with the InstallUtil. Instead I had to go to the output directory of the build process where 2 files are located. An msi-file and a setup.exe file. The msi installs the service, BUT there is no name changes. However if I run the setup.exe, it does the same but name changes to the service are included. So I guess the projectinstaller/serviceinstaller are included in the setup.exe and not the other.</p>
  
  <p>Lastly, thank you all for your help.</p>