473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

WMI error using System.Management.ManagementClass

I've got a VB.NET windows application (written in VS .NET 2003) that makes a
call to WMI for retrieving the MAC Address from the client's PC. It works on
4 out of the 5 PC's tested so far. All the workstations are DELLs running XP
SP1a with the 1.1 .NET Framework. The following line of code generates an
exception on the one PC:

Dim oMac As New
System.Management.ManagementClass("Win32_NetworkAd apterConfiguration")

The error it generates is:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in
system.management.dll
Additional information: The specified module could not be found.
Additional information: The type initializer for
"System.Management.MTAHelper" threw an exception.
System.TypeInitializationException: The type initializer for
"System.Management.ManagementPath" threw an exception. --->
System.TypeInitializationException: The type initializer for
"System.Management.MTAHelper" threw an exception. --->
System.IO.FileNotFoundException: The specified module could not be found.
at System.Management.MTAHelper..cctor()
--- End of inner exception stack trace ---
at System.Management.MTAHelper.CreateInMTA(Type type)
at System.Management.ManagementPath.CreateWbemPath(St ring path)
at System.Management.ManagementPath..ctor(String path)
at System.Management.ManagementPath..cctor()
--- End of inner exception stack trace ---
at System.Management.ManagementPath..ctor(String path)
at System.Management.ManagementClass..ctor(String path)
at SEMS.ClientControls.CookieLib.GetMACAddress() in CookieLib.vb:line 55

We've tried the following items to no avail:
1) shutting down the WMI Service, deleting the repository, and restarting
the service.
2) Reinstalling the .NET framework, SP1a, and all the windows updates except
for SP2.
3) Confirming the services are running
4) Running the app while logged in as Administrator
5) Reinstalling the network adapter
6) We have VS 2003 installed on this PC so we installed the WMI Extensions
for VS 2003 Server explorer. It installed w/o any errors, however when you
click on the "Management Classes" item in the treeview it throws the same
exception.

Any insight into what we can do to determine why the exception occurs and
what we can do to fix this would be greatly appreciated.
Jul 21 '05 #1
2 13941
Try using wbemtest.exe from the commandline, try to connect to root\cimv2
and execute the same query - (select * from
Win32_NetworkAdapterConfiguration).

If this doesn't work (which I expect) it's not a .NET issue.

Willy.
"Paul Gronka" <Pa********@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
I've got a VB.NET windows application (written in VS .NET 2003) that makes
a
call to WMI for retrieving the MAC Address from the client's PC. It works
on
4 out of the 5 PC's tested so far. All the workstations are DELLs running
XP
SP1a with the 1.1 .NET Framework. The following line of code generates an
exception on the one PC:

Dim oMac As New
System.Management.ManagementClass("Win32_NetworkAd apterConfiguration")

The error it generates is:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred
in
system.management.dll
Additional information: The specified module could not be found.
Additional information: The type initializer for
"System.Management.MTAHelper" threw an exception.
System.TypeInitializationException: The type initializer for
"System.Management.ManagementPath" threw an exception. --->
System.TypeInitializationException: The type initializer for
"System.Management.MTAHelper" threw an exception. --->
System.IO.FileNotFoundException: The specified module could not be found.
at System.Management.MTAHelper..cctor()
--- End of inner exception stack trace ---
at System.Management.MTAHelper.CreateInMTA(Type type)
at System.Management.ManagementPath.CreateWbemPath(St ring path)
at System.Management.ManagementPath..ctor(String path)
at System.Management.ManagementPath..cctor()
--- End of inner exception stack trace ---
at System.Management.ManagementPath..ctor(String path)
at System.Management.ManagementClass..ctor(String path)
at SEMS.ClientControls.CookieLib.GetMACAddress() in CookieLib.vb:line 55

We've tried the following items to no avail:
1) shutting down the WMI Service, deleting the repository, and restarting
the service.
2) Reinstalling the .NET framework, SP1a, and all the windows updates
except
for SP2.
3) Confirming the services are running
4) Running the app while logged in as Administrator
5) Reinstalling the network adapter
6) We have VS 2003 installed on this PC so we installed the WMI Extensions
for VS 2003 Server explorer. It installed w/o any errors, however when
you
click on the "Management Classes" item in the treeview it throws the same
exception.

Any insight into what we can do to determine why the exception occurs and
what we can do to fix this would be greatly appreciated.

Jul 21 '05 #2
Hi Paul,

How the problem was solved? I am having same problem.
I've got a VB.NET windows application (written in VS .NET 2003) that makes a
call to WMI for retrieving the MAC Address from the client's PC. It works on
4 out of the 5 PC's tested so far. All the workstations are DELLs running XP
SP1a with the 1.1 .NET Framework. The following line of code generates an
exception on the one PC:

Dim oMac As New
System.Management.ManagementClass("Win32_NetworkAd apterConfiguration")

The error it generates is:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in
system.management.dll
Additional information: The specified module could not be found.
Additional information: The type initializer for
"System.Management.MTAHelper" threw an exception.
System.TypeInitializationException: The type initializer for
"System.Management.ManagementPath" threw an exception. --->
System.TypeInitializationException: The type initializer for
"System.Management.MTAHelper" threw an exception. --->
System.IO.FileNotFoundException: The specified module could not be found.
at System.Management.MTAHelper..cctor()
--- End of inner exception stack trace ---
at System.Management.MTAHelper.CreateInMTA(Type type)
at System.Management.ManagementPath.CreateWbemPath(St ring path)
at System.Management.ManagementPath..ctor(String path)
at System.Management.ManagementPath..cctor()
--- End of inner exception stack trace ---
at System.Management.ManagementPath..ctor(String path)
at System.Management.ManagementClass..ctor(String path)
at SEMS.ClientControls.CookieLib.GetMACAddress() in CookieLib.vb:line 55

We've tried the following items to no avail:
1) shutting down the WMI Service, deleting the repository, and restarting
the service.
2) Reinstalling the .NET framework, SP1a, and all the windows updates except
for SP2.
3) Confirming the services are running
4) Running the app while logged in as Administrator
5) Reinstalling the network adapter
6) We have VS 2003 installed on this PC so we installed the WMI Extensions
for VS 2003 Server explorer. It installed w/o any errors, however when you
click on the "Management Classes" item in the treeview it throws the same
exception.

Any insight into what we can do to determine why the exception occurs and
what we can do to fix this would be greatly appreciated.


User submitted from AEWNET (http://www.aewnet.com/)
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Lucas | last post by:
I have been reading many of the posts about determining which network card to use (in a machine with multiple nics), and determining whether or not that card is active. I'm hoping this will help...
0
by: Praveen | last post by:
Hello. I am writing some code that accepts a DFS Link and Username and grants that User permissions to the physical directory that the DFS Link corresponds to. I am using the System.Management...
9
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
2
by: Paul Gronka | last post by:
I've got a VB.NET windows application (written in VS .NET 2003) that makes a call to WMI for retrieving the MAC Address from the client's PC. It works on 4 out of the 5 PC's tested so far. All...
1
by: lecnac | last post by:
Here's some details: Server and workstation both in the same workgroup Logged into server as local Administrator Logged into workstation as a local user that is only in the Users group The...
1
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is...
0
by: sachinrohamare | last post by:
I am getting following error while iterating through the ManagementObjectCollection: This error is coming only for the first time. From the 2nd run onwards the code is executed successfully....
1
by: remya1000 | last post by:
from my system i need to open a calculator in remote machine. and i'm using Vb.net and WMI. i need to pop up the calculator in remote machine, while i run one program in my system. while running in...
1
by: andygunther | last post by:
I have the following code that I am trying to use to join a computer to a domain in a C# wizard application I am writing. I get an unhandled exception from System.Management.dll as soon as I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.