473,405 Members | 2,294 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,405 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 13972
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.