System.Management.ManagementException : Provider Load Failure

  • Thread starter Thread starter Daniel Edwards
  • Start date Start date
D

Daniel Edwards

I have some code which works on a standard XP system, but fails on XP
Embedded test machine.

I get System.Management.ManagementException : Provider Load Failure

// this is C# code likely the cause of the exception
ManagementObject disk;
disk = new ManagementObject("Win32_Logicaldisk=\"" + drive + "\"");
disk.Get();
HDDsize = Convert.ToDouble(disk["Size"].ToString());
FreeSpace = Convert.ToDouble(disk["FreeSpace"].ToString());

I believe there is a missing component. Probably one of the WMI components.
I don't know exactly. Has anyone seen this issue before?
 
Daniel:

What WMI components do you have in your image? I would think that you
atleast need "WMI Win32 Provider".

HTH... Doug
 
Found the answer. Need to include c:\windows\system32\dskquota.dll


Doug Hoeffel said:
Daniel:

What WMI components do you have in your image? I would think that you
atleast need "WMI Win32 Provider".

HTH... Doug
Daniel Edwards said:
I have some code which works on a standard XP system, but fails on XP
Embedded test machine.

I get System.Management.ManagementException : Provider Load Failure

// this is C# code likely the cause of the exception
ManagementObject disk;
disk = new ManagementObject("Win32_Logicaldisk=\"" + drive + "\"");
disk.Get();
HDDsize = Convert.ToDouble(disk["Size"].ToString());
FreeSpace = Convert.ToDouble(disk["FreeSpace"].ToString());

I believe there is a missing component. Probably one of the WMI components.
I don't know exactly. Has anyone seen this issue before?
 
Back
Top