While trying to get a list of services from localhost...
An unhandled exception of type 'System.Management.ManagementException' occurred in system.management.dll
Additional information: Invalid namespace
I have the System.Management reference,
I have also imported the namespace.
The query is:
strQuery = "SELECT * FROM Win32_Service"
//setup
query = new ManagementObjectSearcher(ms, oq);
//This line generates the error
queryCollection = query.Get();
Ideas?