Export (0) Print
Expand All

Installing and Uninstalling Services

Visual Studio .NET 2003

Unlike most projects you create in Visual Studio .NET, Windows Service projects cannot be run directly from the development environment by pressing F5. This is because the service in the project must be installed before the project can run.

You can quickly install your service application by using a command line utility called InstallUtil.exe. You can also create a setup project that contains your project's output and create a custom action with it that will run the installers associated with the project and install your service. For an example, see Walkthrough: Creating a Windows Service Application in the Component Designer. For more information on setup projects, see Setup Projects. For more information on custom actions, see Walkthrough: Creating a Custom Action.

To install your service manually

  1. Access the directory in which your project's compiled executable file is located.
  2. Run InstallUtil.exe from the command line with your project's output as a parameter. Enter the following code on the command line:
    installutil yourproject.exe
    

To uninstall your service manually

  • Run InstallUtil.exe from the command line with your project's output as a parameter. Enter the following code on the command line:
    installutil /u yourproject.exe
    
    Tip   You can launch Server Explorer, and verify that your service has been installed or uninstalled. For more information on launching Server Explorer, see Accessing and Initializing Server Explorer.
    Note   The Servers node of the Server Explorer is not available in the Standard Edition of Visual Basic and Visual C# .NET. For more information, see Visual Basic Standard Edition Features or Visual C# Standard Edition Features.

See Also

Introduction to Windows Service Applications | Creating Windows Services | Adding Installers to your Service Application | Introduction to Installation Components | Configuring Installation Components | Overriding Default Methods on Installation Components| Accessing and Initializing Server Explorer | Walkthrough: Creating a Windows Service Application in the Component Designer | Setup Projects | Walkthrough: Creating a Custom Action

Show:
© 2014 Microsoft