title: Debug Windows Service
body: <h3>Scenario</h3>
  
  <p>I've got a windows service written in C#.
  I've read all the google threads on how to debug it, but I still can't get it to work.
  I've run "PathTo.NetFramework\InstallUtil.exe C:\MyService.exe". It said the install was successful, however when I run "Services.msc", The service isn't displayed at all, anywhere. If I go into Task Manager, there is a process called "MyService.vshost.exe". Pretty sure that's not it, because it's a service, not a process.</p>
  
  <h3>Can Someone Explain To Me?</h3>
  
  <p>If I am supposed to see the service when I run Services.msc?
  (Bearing in mind this is all being done on a local machine, with no servers AT ALL.</p>
  
  <h3>Other</h3>
  
  <p>I'm running VS2008.</p>
  
  <h3>EDIT:</h3>
  
  <p>This is all being done on my local machine, I have no servers or access to any.
  Also, I don't even know what the service does, I want to debug it so I can walkthrough the code and see how it all works (the code inside the service, not the service itself - for any of you smarty pants that might suggest I look at a template).</p>
  
  <h3>EDIT 2:</h3>
  
  <p>NONE OF THESE ARE WORKING!
  Everytime I try something I get some message about having to use NET START or install the service.</p>
  
  <h3>EDIT 3:</h3>
  
  <p>I'm running VS2008.</p>
  
  <p>I typed this:
  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe C:\dev\Restarter\bin\Release\Restarter.exe</p>
  
  <p>I got this:
  Microsoft (R) .NET Framework Installation utility Version 2.0.50727.3053
  Copyright (c) Microsoft Corporation.  All rights reserved.</p>
  
  <p>Running a transacted installation.</p>
  
  <p>Beginning the Install phase of the installation.
  See the contents of the log file for the C:\dev\Restarter\bin\
  Release\Restarter.exe assembly's progress.
  The file is located at C:\dev\Restarter\bin\Release\EDT.Restar
  ter.InstallLog.
  Installing assembly 'C:\dev\Restarter\bin\Release\Restarter.exe'.
  Affected parameters are:
     logtoconsole =
     assemblypath = C:\dev\Restarter\bin\Release\Restarter.exe
     logfile = C:\dev\Restarter\bin\Release\Restarter.InstallLog</p>
  
  <p>The Install phase completed successfully, and the Commit phase is beginning.
  See the contents of the log file for the C:\dev\Restarter\bin\
  Release\Restarter.exe assembly's progress.
  The file is located at C:\dev\Restarter\bin\Release\Restar
  ter.InstallLog.
  Committing assembly 'C:\dev\Restarter\bin\Release\Restarter.exe'.
  Affected parameters are:
     logtoconsole =
     assemblypath = C:\dev\Restarter\bin\Release\Restarter.exe
     logfile = C:\dev\Restarter\bin\Release\Restarter.InstallLog</p>
  
  <p>The Commit phase completed successfully.</p>
  
  <p>The transacted install has completed.</p>
  
  <p>C:\Program Files\Microsoft Visual Studio 9.0\VC></p>
  
  <p>I then went to RUN -> Services.msc
  I can see nothing in there.</p>
  
  <p>There is a process in Task Manager called "Restarter.vshost.exe".</p>
  
  <p>That's it.</p>
  
  <p>I only wanted to install and debug it.
  I know it works (as it it runs and doesn't crash).
  But the code was written by a friend and I want to understand the underlying code by walking through it in debug mode.</p>