By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

WMI error using System.Management.ManagementClass

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.