I just installed Visual Studio 2010 with .NET Framework 4.0 and C# and I can’t find anything under the System.Management namespace except for System.Management.Instrumentation. All the online documentation at MSDN about WMI keeps telling me that I have to use classes such as System.Management.ManagementObjectSearcher or System.Management.ManagementScope but I don’t see those classes.
What happened to those classes and how can I access them?
You need to add a reference to
System.Management.dllto your project.You can see
System.Management.Instrumentationwithout adding a reference toSystem.Management.dllbecause it is included in a different library (System.Core.dll, which is included as a reference automatically), but you cannot access the other types contained by that namespace without explicitly adding a reference to theSystem.Management.dlllibrary.