473,713 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WMI error using System.Manageme nt.ManagementCl ass

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.Manageme nt.ManagementCl ass("Win32_Netw orkAdapterConfi guration")

The error it generates is:

An unhandled exception of type 'System.IO.File NotFoundExcepti on' occurred in
system.manageme nt.dll
Additional information: The specified module could not be found.
Additional information: The type initializer for
"System.Managem ent.MTAHelper" threw an exception.
System.TypeInit ializationExcep tion: The type initializer for
"System.Managem ent.ManagementP ath" threw an exception. --->
System.TypeInit ializationExcep tion: The type initializer for
"System.Managem ent.MTAHelper" threw an exception. --->
System.IO.FileN otFoundExceptio n: The specified module could not be found.
at System.Manageme nt.MTAHelper..c ctor()
--- End of inner exception stack trace ---
at System.Manageme nt.MTAHelper.Cr eateInMTA(Type type)
at System.Manageme nt.ManagementPa th.CreateWbemPa th(String path)
at System.Manageme nt.ManagementPa th..ctor(String path)
at System.Manageme nt.ManagementPa th..cctor()
--- End of inner exception stack trace ---
at System.Manageme nt.ManagementPa th..ctor(String path)
at System.Manageme nt.ManagementCl ass..ctor(Strin g path)
at SEMS.ClientCont rols.CookieLib. GetMACAddress() in CookieLib.vb:li ne 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 14042
Try using wbemtest.exe from the commandline, try to connect to root\cimv2
and execute the same query - (select * from
Win32_NetworkAd apterConfigurat ion).

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

Willy.
"Paul Gronka" <Pa********@dis cussions.micros oft.com> wrote in message
news:3F******** *************** ***********@mic rosoft.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.Manageme nt.ManagementCl ass("Win32_Netw orkAdapterConfi guration")

The error it generates is:

An unhandled exception of type 'System.IO.File NotFoundExcepti on' occurred
in
system.manageme nt.dll
Additional information: The specified module could not be found.
Additional information: The type initializer for
"System.Managem ent.MTAHelper" threw an exception.
System.TypeInit ializationExcep tion: The type initializer for
"System.Managem ent.ManagementP ath" threw an exception. --->
System.TypeInit ializationExcep tion: The type initializer for
"System.Managem ent.MTAHelper" threw an exception. --->
System.IO.FileN otFoundExceptio n: The specified module could not be found.
at System.Manageme nt.MTAHelper..c ctor()
--- End of inner exception stack trace ---
at System.Manageme nt.MTAHelper.Cr eateInMTA(Type type)
at System.Manageme nt.ManagementPa th.CreateWbemPa th(String path)
at System.Manageme nt.ManagementPa th..ctor(String path)
at System.Manageme nt.ManagementPa th..cctor()
--- End of inner exception stack trace ---
at System.Manageme nt.ManagementPa th..ctor(String path)
at System.Manageme nt.ManagementCl ass..ctor(Strin g path)
at SEMS.ClientCont rols.CookieLib. GetMACAddress() in CookieLib.vb:li ne 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.Manageme nt.ManagementCl ass("Win32_Netw orkAdapterConfi guration")

The error it generates is:

An unhandled exception of type 'System.IO.File NotFoundExcepti on' occurred in
system.manageme nt.dll
Additional information: The specified module could not be found.
Additional information: The type initializer for
"System.Managem ent.MTAHelper" threw an exception.
System.TypeInit ializationExcep tion: The type initializer for
"System.Managem ent.ManagementP ath" threw an exception. --->
System.TypeInit ializationExcep tion: The type initializer for
"System.Managem ent.MTAHelper" threw an exception. --->
System.IO.FileN otFoundExceptio n: The specified module could not be found.
at System.Manageme nt.MTAHelper..c ctor()
--- End of inner exception stack trace ---
at System.Manageme nt.MTAHelper.Cr eateInMTA(Type type)
at System.Manageme nt.ManagementPa th.CreateWbemPa th(String path)
at System.Manageme nt.ManagementPa th..ctor(String path)
at System.Manageme nt.ManagementPa th..cctor()
--- End of inner exception stack trace ---
at System.Manageme nt.ManagementPa th..ctor(String path)
at System.Manageme nt.ManagementCl ass..ctor(Strin g path)
at SEMS.ClientCont rols.CookieLib. GetMACAddress() in CookieLib.vb:li ne 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
4563
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 others who are struggling with the same issues. This info exists in the groups, but not all in the same place. Thanks to everyone who contributes. Well done! Consider the following code:
0
2334
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 namespace and WMI queries. When I run the code below and check the Security tab of the folder , I find that all entries have been cleared – which is ok and this is expected, main problem is that the User that I have set up the Trustee and ACE...
9
10899
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 the wheel, right? Everything so far is working well with the Active Directory. The problem I am having is with adding File Permissions to a directory. I am currently using some code courtesy of "Willy Denoyette "
2
2148
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 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...
1
2903
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 local user on the workstation is also defined with same name and password on the server (and only in the Users group on the server) Server is Windows Server 2003 running IIS 6.0 Workstation is Windows XP Professional ASP.NET 2.0 (C#) web site
1
3703
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 quickly becoming more and more urgent. I've tried the code below using the server's local Administrator user name and password. This gets me past the Access denied error but gives me a User
0
2194
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. Surprisingly when I execute the code with the gap of 20-25 minutes the error is reproducible! Please provide the solution urgently. Thanks in Advance ! Please check the error details, sample C# code I am using. Regards,
1
5664
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 rmotre machine's taskmanager the calculator is displaying, but its not popuping. i tried this code for pop up using Win32_ProcessStartup like this... Module Module1 Sub Main() Dim retValue As String retValue = RunCommand("calc.exe",...
1
4037
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 instantiate the ManagementClass (first line). Has anyone been able to do this in the past? All of the examples I can find are using VBScript - nothing in C#: try { System.Management.ManagementClass mc = new...
0
8701
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9168
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9068
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7942
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4462
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4715
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3155
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2103
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.