Unlike most projects created in Visual Studio, Windows service projects cannot be run directly from the development environment by pressing F5. This is because the project cannot run until the service in the project has to be installed.
By using a command-line utility named InstallUtil.exe, you can quickly install a service application. You can also create a setup project that contains the output of your project and use it to create a custom action that runs the Setup program associated with the project and installs the service. For an example, see Walkthrough: Creating a Windows Service application in the Component Designer. For more information about installation projects, see installation Projects. For more information about custom actions, see Walkthrough: Creating a Custom action. Manual Installation Services
Access the directory where the compiled executable files in the project reside.
Run InstallUtil.exe from the command line with the output of the project as an argument. Enter the following code on the command line: Copy
InstallUtil Yourproject.exe
Manual Uninstall Service
Run InstallUtil.exe from the command line with the output of the project as an argument. Enter the following code on the command line: Copy
Installutil/u Yourproject.exe
Tips: |
You can start Server Explorer, and then verify that the service is installed or uninstalled. For more information, see How to: Access and Initialize Server Explorer/Database Explorer. |
Please see
task How to: Create a Windows Service How to: Add an installer to a service application how to: Configure Installation Components How to: Override default methods on installation components Walkthrough: Creating a Windows Service application in the Component Designer Walkthrough: Creating a Custom action