'C sharp code terminates without exception
I have this code:
public static bool Run(IntPtr handle, IntPtr imethodName, IntPtr iobject, IntPtr itransaction, IntPtr imethod )
{
try {
String methodName = Marshal.PtrToStringAuto(imethodName);
CooRuntime.Trace("Executing cooAssembly.GetTypes()");
Type[] types = cooAssembly.GetTypes();
CooRuntime.Trace("Executing types[0]");
Type theType = types[0];
CooRuntime.Trace("Executing GetMethod >>>>" + methodName + "<<<<");
MethodInfo method = theType.GetMethod(methodName);
CooRuntime.Trace("new CooObject");
CooObject cooobject = new CooObject(iobject);
CooRuntime.Trace("new CooTransaction");
CooTransaction transaction = new CooTransaction(itransaction);
CooRuntime.Trace("new CooMethod");
CooMethod coomethod = new CooMethod(imethod);
CooRuntime.Trace("method.Invoke and return");
return (bool)method.Invoke( null, new object[] {cooobject, transaction, coomethod} );
}
catch (Exception e) {
CooRuntime.Trace("Exception when executing: " + e.ToString());
}
catch {
CooRuntime.Trace("Exception when executing: unknown");
}
CooRuntime.Trace("return false");
return false;
}
The last line in my trace output is "new CooObject". No exception is caught, it looks for mee, that the thread simmply terminates. Since I'm C++ dev not C# I have no idea, where I can search for the reason.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
