Question Can't see the ServiceController class

philippe12345

New member
Joined
Jun 13, 2011
Messages
2
Programming Experience
1-3
Hi,
I tried to get all the services on the local system with this :

ServiceController.GetServices()

The problem is that I can't access to the ServiceController.
In the namespace System.ServiceProcess, I can only access the namespace "Design".

ServiceController is in the System.ServiceProcess namespace but I can't see it.

Is there another way to get all the local running services or did I forget something?

I also added "imports System.ServiceProcess"

Thanks!
 
In the documentation for each class in .Net Framework you can see what library that defines it and in which namespace the class belongs, like here: ServiceController Class (System.ServiceProcess)
Namespace: System.ServiceProcess
Assembly: System.ServiceProcess (in System.ServiceProcess.dll)
The assembly is what you need to add reference to be able to use the library, and the namespace you must use either by qualifying the type or by importing it.
 
Back
Top