5

When executing the following code, the searcher.Get() throws an exception "Not Supported". Even when running as admin the problem persists. This is compiled with VS 2010. The exception happens on XP, Win7 and Win8.1. Any ideas??

 ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSSerial_PortName");
 foreach (ManagementObject queryObj in searcher.Get())
 {
 }
edtheprogrammerguy
  • 5,957
  • 6
  • 28
  • 47

0 Answers0