?
Solved

ManagementObject not recognized in asp.net app

Posted on 2011-02-14
4
Medium Priority
?
915 Views
Last Modified: 2012-05-11
I'm trying to use the ManagementObject object to get information about my servers hard drive.  I added the namespace using System.Management;  But it still errors saying:
Error      11      The type or namespace name 'ManagementObject' could not be found (are you missing a using directive or an assembly reference?)      C:\Documents and Settings\Administrator\Desktop\SH_Source\Admin_Pages\Home.aspx.cs      92      1      C:\...\SH_Source\

It almost seems like my .NET framework doesn't include it, but it should I'd think.  Any ideas?
0
Comment
Question by:JT_SIRO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 34891808
Are you sure you have a reference added to "System.Management"? Just because the namespace is available, doesn't mean you're looking at the one you intend  = )
0
 
LVL 5

Accepted Solution

by:
jijeesh earned 500 total points
ID: 34891832
You need to add a Reference to System.Management dll.
0
 

Author Comment

by:JT_SIRO
ID: 34892228
I have: using System.Management;  in my code so I'd think it'd work.
Is that what you meant by adding a reference to System.Management dll?  Or do I make the reference in a config file or something?

Here's the line of code that fails:
ManagementObject disk = new
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 500 total points
ID: 34892278
>>  Is that what you meant by adding a reference to System.Management dll?

No. Go to Project-->Add Reference-->System.Management.dll


untitled.png
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question