title: Is the Win32_Processor and Win32_NetworkAdapterConfiguration WMI methods available in Windows 8?
body: <p>I am testing an existing application in the Windows 8 consumer preview and it crashes upon launching.  The log files indicate it is in the method where I do some validation on the CPU ID and Network card details.  </p>
  
  <p>To do this, I am calling </p>
  
  <pre><code>        ManagementClass mc = new ManagementClass("Win32_Processor");
          ManagementObjectCollection moc = mc.GetInstances();
          foreach (ManagementObject mo in moc)
          {
              if (cpuInfo.Length == 0)
              {
                  // only return cpuInfo from first CPU
                  cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
              }
          }
  </code></pre>
  
  <p>(Note that this application works fine on Windows 7 and earlier).</p>
  
  <p>I then use the same syntax for hooking into Win32_NetworkAdapterConfiguration and getting the IPEnabled, IPAddress[], and MACAddress properties.</p>
  
  <p>But somewhere in here it is crashing.</p>
  
  <p>I have tried to research this already, and found the following <a href="http://social.technet.microsoft.com/wiki/contents/articles/windows-8-server-wmi-classes-with-methods.aspx" rel="noreferrer">Windows 8 server list of WMI classes and methods</a> and the ones I am using are not on it.  However, the same site has a list of <a href="http://social.technet.microsoft.com/wiki/contents/articles/windows-7-wmi-classes-with-methods.aspx" rel="noreferrer">Windows 7 WMI classes and methods</a> too, and these aren't in that either! (Even though it works on Windows 7 no problem).</p>
  
  <p>So from the look of that, it is not supported.  </p>
  
  <p>The MSDN for the ManagementClass indicates that the method <a href="http://msdn.microsoft.com/en-us/library/15s54685%28v=vs.110%29.aspx" rel="noreferrer">is still present in .NET 4.5</a>.  Additionally, <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa389273%28v=vs.85%29.aspx" rel="noreferrer">this Microsoft resource</a> does explicitly list Win32_Processor and Win32_NetworkAdapterConfiguration, with the methods I need.</p>
  
  <p>So, from the links, you can see I have tried to research this, so this is my last stop in trying to solve this mystery.</p>
  
  <p>My app is originally a .NET 2.0 solution created in Visual Studio 2005.  I have installed Visual Studio 2011 Beta into my Windows 8 Consumer Preview VM, along with the latest SQL 2012 Express.  I have tried importing my project into this Visual Studio but it doesn't load it, telling me that it only supports Metro development.  Therefore I cannot debug this issue on the machine itself.</p>
  
  <p>So my question is specifically do these classes exist in Windows 8?  If they do, then what am I doing wrong?  If they don't, then I need to find out a way to still get this information - but I guess that's a separate question ;-)</p>