VB.Net & WMI System.Management in VB 2005 Express Ed. Beta

D

Dominic Marks

Hello All,

Hope this is the correct group, here goes:

I'm looking into writing a small application to interface with WMI, and
downloaded the Express Edition Beta of Visual Basic 2005 to see how
feasible it is. I've learnt so far that I need access to the
System.Management namespace. In my sample application I can't import
this however, VB 2005 reports:

Namespace or type specified in the Imports 'System.Management' cannot
be found.

This is on a Windows 2000 PC with various WMI tools and scripts on
which all work fine, so what am I doing wrong? Is there a mystery
download for something I've missed? Everything I have read so far
indicates that it should be installed already.

Thanks,
 
D

Dominic Marks

Dominic said:
Hello All,

Hope this is the correct group, here goes:

I'm looking into writing a small application to interface with WMI, and
downloaded the Express Edition Beta of Visual Basic 2005 to see how
feasible it is. I've learnt so far that I need access to the
System.Management namespace. In my sample application I can't import
this however, VB 2005 reports:

Namespace or type specified in the Imports 'System.Management' cannot
be found.

Before anyone else says it, I needed to Add a Reference to
System.Management.dll in my project before I could use it.

Project -> Add Reference -> .Net
Then Choose System.Management.dll from the list.
This is on a Windows 2000 PC with various WMI tools and scripts on
which all work fine, so what am I doing wrong? Is there a mystery
download for something I've missed? Everything I have read so far
indicates that it should be installed already.

Thanks,

Easy when you know how!
 
G

Greg Burns

The Imports statement is just a shortcut so that you don't have to type
"System.Management" all the time in front of those classes in that
namespace. You still need to add a reference to the correct .dll file.

Right-click your project in Project Explorer and select Add Reference...
You'll find System.Management.dll under the .NET tab.

HTH,
Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top