title: Windows service won't install: The specified service already exists
body: <p>I'm writing a small service in C# and I've installed it and uninstalled it a couple of times and all of a sudden it won't install again. I tried to uninstall it and it says there is nothing to uninstall, but when I install it again I get the following message: </p>
  
  <blockquote>
    <p>Error 1001: The specified service already exists</p>
  </blockquote>
  
  <p>Now, I've tried the following solutions:</p>
  
  <ul>
  <li><p>Close the service manager (as an open service manager may hold a
  handle to it)</p></li>
  <li><p>Tried to find it with SC QUERY and delete is using SC DELETE
  (according to
  <a href="https://stackoverflow.com/questions/5599141/service-already-exists-when-it-clearly-doesnt">Service already exists (when it clearly doesn&#39;t)</a>)</p></li>
  <li><p>Tried to remove it in regedit (doesn't exist there)</p></li>
  <li><p>I've correctly added the project output to Custom Actions (install,
  commit, rollback, uninstall)</p></li>
  <li><p>Restarted the computer (!)</p></li>
  </ul>
  
  <p>I'm running out of ideas. There is absolutely no proof that the service is installed on my computer and even though thousands of developers seems to have had this problem (and I've even had it myself previously) I've never heard of a situation where none of the standard solutions actually works.</p>
  
  <p>What could I have missed?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've been into regedit and I tried again to find my service, but this time I exported the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ section and searched it. I can find my service in the dump under:</p>
  
  <blockquote>
    <p>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService</p>
  </blockquote>
  
  <p>But then I go there in the regedit view, it's not there. Any suggestions? How did I screw that up :?</p>
  
  <p><strong>RE-EDIT</strong></p>
  
  <p>Disregard edit, the service only shows in regedit while the install i showing the error message, but that's event weirder, the service is installed, then breaks and rollbacks...</p>