using System.Management;

Is not enough. 

You need to add the reference to System.Management too. 


In VS2015, go to the Solution Explorer, and expand your project, right click on the References folder/option and select Add References from the context menu. Now select the "Assemblies" tab , and select the "Framework",  and then enable the "System.Management" from the list and click OK.