Objectmix
Tags Register Mark Forums Read

An unhandled exception of type 'System.ExecutionEngineException' occurred in system.management.dll : DOTNET

This is a discussion on An unhandled exception of type 'System.ExecutionEngineException' occurred in system.management.dll within the DOTNET forums in Framework and Interface Programming category; Hi, I am trying to read from another computer a WMI Provider value. I get this exception from C# code using WMI .NET instrumentation: "An unhandled exception of type 'System.ExecutionEngineException' occurred in system.management.dll" The debugger points to the wmiParam[strValue]) line. Here is the code i am using: private void TestWMI(string strMgmtPath, string strValue) { ManagementObject wmiParam = new ManagementObject(strMgmtPath); ConnectionOptions objConnOpt = new ConnectionOptions(); objConnOpt.Username = "user"; objConnOpt.Password = "123456"; wmiParam.Scope.Options = objConnOpt; // read provider value double f = Convert.ToDouble(wmiParam[strValue]); // this is the line indicated by debugger Console.WriteLine(" Value: {0:F20}", f); wmiParam.Dispose(); } TestWMIParameter2(@"\\192.168.1.11\root\CIMV2:Win3 2_PerfRawData_SMTPSVC_SMTPServer.Name='_Total'", "AvgRecipientsPermsgSent"); I am ...


Object Mix > Framework and Interface Programming > DOTNET > An unhandled exception of type 'System.ExecutionEngineException' occurred in system.management.dll

DOTNET Discussion forums related to Microsoft Dot net technologies, CSharp and other related items

Reply

 

LinkBack Thread Tools
  #1  
Old 04-28-2006, 09:10 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default An unhandled exception of type 'System.ExecutionEngineException' occurred in system.management.dll

Hi,

I am trying to read from another computer a WMI Provider value.
I get this exception from C# code using WMI .NET instrumentation:

"An unhandled exception of type 'System.ExecutionEngineException' occurred
in system.management.dll"

The debugger points to the wmiParam[strValue]) line.

Here is the code i am using:

private void TestWMI(string strMgmtPath, string strValue)
{
ManagementObject wmiParam = new ManagementObject(strMgmtPath);

ConnectionOptions objConnOpt = new ConnectionOptions();
objConnOpt.Username = "user";
objConnOpt.Password = "123456";
wmiParam.Scope.Options = objConnOpt;

// read provider value
double f = Convert.ToDouble(wmiParam[strValue]); // this is the line
indicated by debugger

Console.WriteLine(" Value: {0:F20}", f);
wmiParam.Dispose();
}

TestWMIParameter2(@"\\192.168.1.11\root\CIMV2:Win3 2_PerfRawData_SMTPSVC_SMTPServer.Name='_Total'",
"AvgRecipientsPermsgSent");

I am getting this exception when reading my own provider too. I then tried
to see if this is happening for another provider, like SMTP.
The exception appears when starting 3,4 processes which try to read the
provider value using the code above, after like 30sec - 1 min.

I am using Visual Studio 2003, .NET Framework 1.1 and Windows XP with SP2.

Any ideas ?

thanks.




Reply With Quote
  #2  
Old 04-28-2006, 10:15 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: An unhandled exception of type 'System.ExecutionEngineException' occurred in system.management.dll

You dont need to have 3,4 processes.
I tested it now and sometimes it appears on a single process also.

I tested it on several machines and I get the same thing. I tested it even
using .NET 2.0 and I get the same thing.

Looks like a serious bug. Any idea ?

on .NET 2.0 it gives this:

System.InvalidCastException: Unable to cast COM object of type
'System.__ComObject' to interface type 'System.Management.IWbemServices'.
This operation failed because the QueryInte
rface call on the COM component for the interface with IID
'{9556DC99-828C-11CF-A37E-00AA003240C7}' failed due to the following error:
The RPC server is unavailable. (Exception fro
m HRESULT: 0x800706BA).
at System.Management.ManagementScope.GetIWbemServices ()
at System.Management.ManagementObject.Initialize(Bool ean getObject)
at System.Management.ManagementBaseObject.get_Propert ies()
at System.Management.ManagementBaseObject.GetProperty Value(String
propertyName)
at System.Management.ManagementBaseObject.get_Item(St ring propertyName)
at ConsoleApplication1.WMITestApp.TestWMIParameter2(S



Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll usenet ADO DAO RDO RDS 3 10-08-2007 11:49 AM
A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll usenet CSharp 1 10-08-2007 11:25 AM
An unhandled exception of type 'System.Net.WebException' occurred in system.web.services.dll usenet DOTNET 1 09-13-2006 11:13 AM
unhandled exception of type 'System.Security.SecurityException' usenet DOTNET 0 03-09-2006 07:36 PM


All times are GMT -5. The time now is 12:17 PM.