ManagementObject Class not showing up in System.Management namespace

I'm trying to write some WMI in my windows form and the ManagementObject is givin me the

"The type or namespace name 'ManagementObject' could not be found" Error

Here is my un-complete code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
using System.Security.Policy;
using System.Management;
using System.Management.Instrumentation;


namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {


            ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"");

Solution 1:

Right-click References on the right and manually add System.Management. Even though I included it in the using statement I still had to do this. Once I did, all worked fine.

Solution 2:

Have you added a reference to the System.Management assembly?

Solution 3:

In Solution Explorer, right click on References, then Add Reference ... and under Framework, you should activate the System.Management framework.