Steve
2006-01-26 22:05:22 UTC
I have two separate VB.NET applications which use a ManagementObject to
query the amount of freespace remaining on local disk drives. Both
applications work fine in my test environments, and in many different
customer deployments.
On one customer's server, however, both of my applications generate an
exception when trying to instantiate the ManagementObject. Here is the
stack trace they end up with:
Unhandled 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.Runtime.InteropServices.COMException (0x80131701): Exception
from HRESULT: 0x80131701.
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.ManagementObject..ctor(String path)
I tried running the wbemtest application on the offending server, and
was able to successfully connect to root\cimv2, query the
Win32_LogicalDisk object, and query the different instances of the
object for their remaining freespace with no problems at all. I'm
guessing this means the .NET framework is to blame on this server.
Is there anything else I can do besides try to uninstall and reinstall
the framework?
Thanks for any help in advance!
--Steve
query the amount of freespace remaining on local disk drives. Both
applications work fine in my test environments, and in many different
customer deployments.
On one customer's server, however, both of my applications generate an
exception when trying to instantiate the ManagementObject. Here is the
stack trace they end up with:
Unhandled 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.Runtime.InteropServices.COMException (0x80131701): Exception
from HRESULT: 0x80131701.
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.ManagementObject..ctor(String path)
I tried running the wbemtest application on the offending server, and
was able to successfully connect to root\cimv2, query the
Win32_LogicalDisk object, and query the different instances of the
object for their remaining freespace with no problems at all. I'm
guessing this means the .NET framework is to blame on this server.
Is there anything else I can do besides try to uninstall and reinstall
the framework?
Thanks for any help in advance!
--Steve