Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8031199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:00:54+00:00 2026-06-05T01:00:54+00:00

I have using System.Management; However, I keep getting this error: The type or namespace

  • 0

I have using System.Management;

However, I keep getting this error:

The type or namespace name ‘ManagementClass’ does not exist in the namespace ‘System.Management’ (are you missing an assembly reference?)

I get that error twice.

I also get this error:

The type or namespace name ‘ManagementObjectCollection’ does not exist in the namespace ‘System.Management’ (are you missing an assembly reference?)

Why does this happen?

If it helps, this is my code (completely taken from StackOverflow, but still the code I’m using)

private string identifier(string wmiClass, string wmiProperty)
    //Return a hardware identifier
    {
        string result = "";
        System.Management.ManagementClass mc = new System.Management.ManagementClass(wmiClass);
        System.Management.ManagementObjectCollection moc = mc.GetInstances();
        foreach (System.Management.ManagementObject mo in moc)
        {

            //Only get the first one
            if (result == "")
            {
                try
                {
                    result = mo[wmiProperty].ToString();
                    break;
                }
                catch
                {
                }
            }

        }
        return result;
    }

    private void getButton_Click(object sender, EventArgs e)
    {
        string modelNo = identifier("Win32_DiskDrive", "Model");
        string manufatureID = identifier("Win32_DiskDrive", "Manufacturer");
        string signature = identifier("Win32_DiskDrive", "Signature");
        string totalHeads = identifier("Win32_DiskDrive", "TotalHeads");
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:00:55+00:00Added an answer on June 5, 2026 at 1:00 am

    The problem is that the DLL is not referenced under Solution/{PROJECT}/References. Right click on References and choose “Add Assembly” (or whatever) and go to the .NET tab and find System.Management.

    Just because the using statement is there does not mean the DLL is referenced.

    A nice guide is over on MSDN.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error: CS0246: The type or namespace name 'ManagementScope' could not be
I have this code (C#): using System.Collections.Generic; namespace ConsoleApplication1 { public struct Thing {
I have this web service : using System.Web.Services; namespace Contracts { [WebService(Namespace = http://tempuri.org/)]
I have this simple example: using System; using System.Collections.Generic; namespace ConsoleApplication1 { class Program
I have the following code: using System; using System.Diagnostics; using System.IO; using PdfSharp.Pdf.Printing; namespace
I have the following code using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace
I have a base class Parent like this: using System; using System.Collections.Generic; using System.Text;
I have a site which is using DNN (DotNetNuke) as a content management system.
Why do I get The type or namespace name 'ManagementEventWatcher' not found in the
I have created an Employee management system using Django. I have done a filtering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.