TargetInvocationException not verbose enough

"AndrĂ©s G. Aragoneses" <[email protected]> Tue, 16 Sep 2008 13:43:32 +0200
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
When NUnit encounters a TargetInvocationException, I get no clue about
the innerException. It would be good that NUnit printed this information.

A snippet of what I get:

1) UiaAtkBridgeTest.BridgeTester.UIACheckBox : Exception has been thrown
by the target of an invocation.
  at System.Reflection.MonoCMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x00086] in
/home/knocte/Documents/iDocs/Proyectos/a11ymono/mcs/class/corlib/System.Ref=
lection/MonoMethod.cs:432

  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr,
System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000] in
/home/knocte/Documents/iDocs/Proyectos/a11ymono/mcs/class/corlib/System.Ref=
lection/MonoMethod.cs:441

  at System.Reflection.ConstructorInfo.Invoke (System.Object[]
parameters) [0x0000e] in
/home/knocte/Documents/iDocs/Proyectos/a11ymono/mcs/class/corlib/System.Ref=
lection/ConstructorInfo.cs:77

  at NUnit.Core.Reflect.Construct (System.Type type) [0x00023] in
/home/knocte/Documents/iDocs/Proyectos/a11ymono/mcs/nunit20/core/Reflect.cs=
:364



NOTE: I cannot use this:

[Test]
public void MyTest (){
  try{
    //..contents of my test..
  }catch(TargetInvocationException ex){ throw ex.InnerException }
}

This hasn't got any effect because it seems the TIE is thrown even
before reaching the contents of the test (maybe it happens in a static
constructor that gets executed before the tests?).

Regards,

	Andr=E9s

-- =


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great priz=
es
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/