M
Mark
Hi...
We have some code written in C# that's trying to manage a farm of servers.
It's using the WMI classes to look at the remote machine for certain
installed packages, and occasionally it blows up but I can't figure out why.
The code is
ManagementScope scope = new
ManagementScope(string.Format(@"\\{0}\root\cimv2", serverName));
scope.Connect();
foreach (Product product in ROOT.CIMV2.Win32.Product.GetInstances(scope))
{
....
}
It blows up on the MoveNext() on the enumerator sometimes but it comes and
goes.
I didn't find anything in the extended info on the ManagementException that
seemed to make it any clearer. That comes out as
<INSTANCE CLASSNAME="__ExtendedStatus">
<QUALIFIER NAME="abstract" PROPAGATED="true" TYPE="boolean"
OVERRIDABLE="false" TOINSTANCE="true"><VALUE>TRUE</VALUE></QUALIFIER>
<PROPERTY NAME="__PATH" CLASSORIGIN="___SYSTEM" TYPE="string"></PROPERTY>
<PROPERTY NAME="__NAMESPACE" CLASSORIGIN="___SYSTEM" TYPE="string"></PROPERTY>
<PROPERTY NAME="__SERVER" CLASSORIGIN="___SYSTEM" TYPE="string"></PROPERTY>
<PROPERTY.ARRAY NAME="__DERIVATION" CLASSORIGIN="___SYSTEM" TYPE="string">
<VALUE.ARRAY><VALUE>__NotifyStatus</VALUE></VALUE.ARRAY>
</PROPERTY.ARRAY>
<PROPERTY NAME="__PROPERTY_COUNT" CLASSORIGIN="___SYSTEM"
TYPE="sint32"><VALUE>5</VALUE></PROPERTY>
<PROPERTY NAME="__RELPATH" CLASSORIGIN="___SYSTEM" TYPE="string"></PROPERTY>
<PROPERTY NAME="__DYNASTY" CLASSORIGIN="___SYSTEM"
TYPE="string"><VALUE>__NotifyStatus</VALUE></PROPERTY>
<PROPERTY NAME="__SUPERCLASS" CLASSORIGIN="___SYSTEM"
TYPE="string"><VALUE>__NotifyStatus</VALUE></PROPERTY>
<PROPERTY NAME="__CLASS" CLASSORIGIN="___SYSTEM"
TYPE="string"><VALUE>__ExtendedStatus</VALUE></PROPERTY>
<PROPERTY NAME="__GENUS" CLASSORIGIN="___SYSTEM"
TYPE="sint32"><VALUE>2</VALUE></PROPERTY>
<PROPERTY NAME="Description" CLASSORIGIN="__ExtendedStatus"
PROPAGATED="true" TYPE="string">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>string</VALUE></QUALIFIER>
</PROPERTY>
<PROPERTY NAME="Operation" CLASSORIGIN="__ExtendedStatus" TYPE="string">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>string</VALUE></QUALIFIER>
<VALUE>ExecQuery</VALUE>
</PROPERTY>
<PROPERTY NAME="ParameterInfo" CLASSORIGIN="__ExtendedStatus" TYPE="string">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>string</VALUE></QUALIFIER>
<VALUE>select * from Win32_Product</VALUE>
</PROPERTY>
<PROPERTY NAME="ProviderName" CLASSORIGIN="__ExtendedStatus" TYPE="string">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>string</VALUE></QUALIFIER>
<VALUE>WinMgmt</VALUE>
</PROPERTY>
<PROPERTY NAME="StatusCode" CLASSORIGIN="__NotifyStatus" PROPAGATED="true"
TYPE="uint32">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>uint32</VALUE></QUALIFIER>
</PROPERTY>
</INSTANCE>
Any pointers on how to determine the cause and make it go away?
Thanks
Mark
We have some code written in C# that's trying to manage a farm of servers.
It's using the WMI classes to look at the remote machine for certain
installed packages, and occasionally it blows up but I can't figure out why.
The code is
ManagementScope scope = new
ManagementScope(string.Format(@"\\{0}\root\cimv2", serverName));
scope.Connect();
foreach (Product product in ROOT.CIMV2.Win32.Product.GetInstances(scope))
{
....
}
It blows up on the MoveNext() on the enumerator sometimes but it comes and
goes.
I didn't find anything in the extended info on the ManagementException that
seemed to make it any clearer. That comes out as
<INSTANCE CLASSNAME="__ExtendedStatus">
<QUALIFIER NAME="abstract" PROPAGATED="true" TYPE="boolean"
OVERRIDABLE="false" TOINSTANCE="true"><VALUE>TRUE</VALUE></QUALIFIER>
<PROPERTY NAME="__PATH" CLASSORIGIN="___SYSTEM" TYPE="string"></PROPERTY>
<PROPERTY NAME="__NAMESPACE" CLASSORIGIN="___SYSTEM" TYPE="string"></PROPERTY>
<PROPERTY NAME="__SERVER" CLASSORIGIN="___SYSTEM" TYPE="string"></PROPERTY>
<PROPERTY.ARRAY NAME="__DERIVATION" CLASSORIGIN="___SYSTEM" TYPE="string">
<VALUE.ARRAY><VALUE>__NotifyStatus</VALUE></VALUE.ARRAY>
</PROPERTY.ARRAY>
<PROPERTY NAME="__PROPERTY_COUNT" CLASSORIGIN="___SYSTEM"
TYPE="sint32"><VALUE>5</VALUE></PROPERTY>
<PROPERTY NAME="__RELPATH" CLASSORIGIN="___SYSTEM" TYPE="string"></PROPERTY>
<PROPERTY NAME="__DYNASTY" CLASSORIGIN="___SYSTEM"
TYPE="string"><VALUE>__NotifyStatus</VALUE></PROPERTY>
<PROPERTY NAME="__SUPERCLASS" CLASSORIGIN="___SYSTEM"
TYPE="string"><VALUE>__NotifyStatus</VALUE></PROPERTY>
<PROPERTY NAME="__CLASS" CLASSORIGIN="___SYSTEM"
TYPE="string"><VALUE>__ExtendedStatus</VALUE></PROPERTY>
<PROPERTY NAME="__GENUS" CLASSORIGIN="___SYSTEM"
TYPE="sint32"><VALUE>2</VALUE></PROPERTY>
<PROPERTY NAME="Description" CLASSORIGIN="__ExtendedStatus"
PROPAGATED="true" TYPE="string">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>string</VALUE></QUALIFIER>
</PROPERTY>
<PROPERTY NAME="Operation" CLASSORIGIN="__ExtendedStatus" TYPE="string">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>string</VALUE></QUALIFIER>
<VALUE>ExecQuery</VALUE>
</PROPERTY>
<PROPERTY NAME="ParameterInfo" CLASSORIGIN="__ExtendedStatus" TYPE="string">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>string</VALUE></QUALIFIER>
<VALUE>select * from Win32_Product</VALUE>
</PROPERTY>
<PROPERTY NAME="ProviderName" CLASSORIGIN="__ExtendedStatus" TYPE="string">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>string</VALUE></QUALIFIER>
<VALUE>WinMgmt</VALUE>
</PROPERTY>
<PROPERTY NAME="StatusCode" CLASSORIGIN="__NotifyStatus" PROPAGATED="true"
TYPE="uint32">
<QUALIFIER NAME="CIMTYPE" PROPAGATED="true" TYPE="string"
TOINSTANCE="true"><VALUE>uint32</VALUE></QUALIFIER>
</PROPERTY>
</INSTANCE>
Any pointers on how to determine the cause and make it go away?
Thanks
Mark