Missing directive or assembly reference using WMI ManagementObjectSearcher?
You are missing a reference to the assembly containing the type ManagementObjectSearcher
, which is in the System.Management
namespace. Add this namespace and it should work.
You will have to rightclick the project -> add reference and add the System.Management assembly. System.Managment is not added automatically with the creation of a new project.