P
Paul Steele
I have some code that uses the WMI class win32_NetworkAdapterConfiguration
to access each adapter in a system. On 99% of the systems the code seems to
work. On a very few the code fails when trying to access the WMI object.
Here's the code:
ManagementClass objMC = new
ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection adapters = objMC.GetInstances();
foreach (ManagementObject adapter in adapters)
...
The call to objMC.GetInstances fails. The error message (via a try/catch) is
simple "Not found" which is basically useless. The computer in question is a
student notebook with all sorts of extras installed, but I don't see
anything obvious that would interfere with WMI. The WMI service is also
running. Google searches have so far come up dry, but I don't have a very
useful item to key my search on. Has anyone got any suggestions on what
might be causing this problem?
to access each adapter in a system. On 99% of the systems the code seems to
work. On a very few the code fails when trying to access the WMI object.
Here's the code:
ManagementClass objMC = new
ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection adapters = objMC.GetInstances();
foreach (ManagementObject adapter in adapters)
...
The call to objMC.GetInstances fails. The error message (via a try/catch) is
simple "Not found" which is basically useless. The computer in question is a
student notebook with all sorts of extras installed, but I don't see
anything obvious that would interfere with WMI. The WMI service is also
running. Google searches have so far come up dry, but I don't have a very
useful item to key my search on. Has anyone got any suggestions on what
might be causing this problem?