Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi All,

I was working with WMI Management Class, I wrote lots of code for installing services on remote machine, fetching running services on remote machine, remote machine information etc.

The code was working fine for me. But suddenly it stopped working on my machine but still it work fine on other machines.
When I run code on my local machine. It will throw INVALID CLASS Error with inner exception is null.
error code is [0x80010105].

Now result is no software using WMI works on my machine like sql server.

I try to browse for error and got this link helpful: http://networkadminkb.com/kb/Knowledge%20Base/Windows2003/WMI%20'Invalid%20Class'%20Error%20caused%20by%20missing%20files.aspx

but Msi.mof, Msiprov.dll files are present on my disc. I am confused now what to do.
I am using windows 7 x64 OS.

There is no issue with code because still it is working for remote machines but not for my local machine.

Any help will be appreciated.

Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 20-Jun-11 3:39am    
How to reproduce it? Where is the code? In what line of code it happens?
--SA
sunder.tinwar 20-Jun-11 4:27am    
Hi, its happening when it queries

ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'");
ManagementObjectCollection queryCollection = query.Get();
foreach (ManagementObject mo in queryCollection) //here on in statement its error out....same in other code when we call get() its will error out...
{
bool dhcpEnabled = Convert.ToBoolean(mo["DHCPEnabled"]);
}
sunder.tinwar 20-Jun-11 4:33am    
Its not the problem with code. As I said other software life sql server configuration manager use WMI, which is getting errored out.

Apart from this I download to WMI Tool from msdn download to check WMI code on machine. That also getting errored out. The exe showing same error.

I hope now you understand problem is not with code.

1 solution

It sounds as if the repository is screwed up.

See what this tool[^] says about it first. You just have to run it from a command prompt, CSCRIPT WMIDIAG.VBS. At the end of the script, it'll tell you where it put the log files to examine.

Then you might have a look at this[^] if the above doesn't help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900