Solved

ManagementObject not recognized in asp.net app

Posted on 2011-02-14
4
897 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 125 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 125 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

696 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