Solved

ManagementObject not recognized in asp.net app

Posted on 2011-02-14
4
890 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

829 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