ServiceController Class

MSBuild

Task that can control a Windows service.


Namespace: MSBuild.Community.Tasks
Assembly: MSBuild.Community.Tasks (in MSBuild.Community.Tasks.dll)

Syntax

Visual Basic (Declaration)
Public Class ServiceController
    Inherits ServiceQuery
C#
public class ServiceController : ServiceQuery
C++
ref class ServiceController : ServiceQuery
J#
public class ServiceController extends ServiceQuery
JScript
public class ServiceController extends ServiceQuery

Example

Restart Web Server

 Copy Code
            <ServiceController ServiceName="w3svc" Action="Restart" />
            

Inheritance Hierarchy

System.Object
   Microsoft.Build.Utilities.Task
      MSBuild.Community.Tasks.ServiceQuery
         MSBuild.Community.Tasks.ServiceController

Thread Safety

Public static (Shared in Visual Basic)staticShared members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

See Also

Syntax based on .NET Framework version 2.0.
Documentation version 1.0.0.0.