The type or namespace name "Management" does not exist in the namespace

I am using “WMI C#” To try to display my computer Processor information onto a UI in unity. But I can not figure out why this will not work, I have tried adding System.Management as a reference as well that did not work, I also tried using “PerformanceCounter” but could not get that to work at all as well, Maybe the code does not work for unity, no clue still learning code so maybe I am over looking something so I figured I would ask on here and maybe someone can point me in the right direction with this project

thanks in advance. here is the code I am currently trying to get to work.

using UnityEngine;
using System;
using System.Management;


namespace SystemInformation
{ 
    public class USAGE
    {
        static void Main(string[] args)
        {
            GetComponent("Win32_Processor", "LoadPercentage");
        }
        private static void GetComponent(string hwclass, string syntax)
        {
            ManagementObjectSearcher mos = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM " + hwclass);
            foreach (ManagementObject mj in mos.Get())
            {
                UnityEngine.Debug.Log(Convert.ToString(mj[syntax]));
            }
        }
    }
}

@braydon97 What you need to do is:

  1. Go into your *C: Program Files\Unity installation folder\Editor\Data\Mono\lib\mono\2.0*
  2. Copy the file named “System.Management.dll”
  3. Go into your Project directory and in the Assets folder create a folder named “Plugins”
  4. Paste the DLL into the Plugins folder.
  5. Wait for Unity to compile the scripts and use the reference as normally.

It worked for me on Windows. Hope it works for you.