Installs a Win32 service that runs a single command on this executable when started. While typically used for the HostHTTP command, it will operate for any command. Commands hosted as a service may use the Console.ReadLine() to wait for the service-stop command.
Syntax
Parameters
- svcName
- The name of the Win32 Service to install.
- displayName
- The description of the Win32 Service.
- startupType
- The service startup type: Automatic, Manual, or Disabled.
- serviceAccount
- The service account: LocalService, NetworkService, or LocalSystem.
- commandName
- The command to run as a service.
- arguments
- The arguments required to run the command.
- ci
- The current command interpreter, used to verify the command 'RunAsService' and the commandName provided.
- executable
- Optional, The path to the executable that is running.
Exceptions
Exception | Description |
System.ApplicationException | The exception that is thrown when a non-fatal application error occurs. |
System.ArgumentNullException | The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also