Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / January 2005

Tip: Looking for answers? Try searching our database.

WMI error using System.Management.ManagementClass

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Gronka - 10 Sep 2004 01:31 GMT
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_NetworkAdapterConfiguration")

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(String 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.
Willy Denoyette [MVP] - 10 Sep 2004 10:35 GMT
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.

> I've got a VB.NET windows application (written in VS .NET 2003) that makes
> a
[quoted text clipped - 49 lines]
> 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.
Guest - 28 Jan 2005 22:45 GMT
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
[quoted text clipped - 43 lines]
> 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/)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.