Subject: Reflection
Posted By: ffbalota Post Date: 12/30/2003 12:38:54 PM
Hi,

I'm invoking a method of a class using reflection and in this method
I'm trying thrown an exception with an specifc message but the exception message in the caller of this method is always "Exception has been thrown by the target of an invocation."


Thank's

Fabio Ferreira Balota
Reply By: Ankur_Verma Reply Date: 1/3/2004 7:06:20 AM
You are getting that exeption message becuase thats actually the exeption messagse. Its indeed the target of invocation that has thrown the exception. If you want to access the message that you threw with your exeption you can do that with  the InnerException property like this.

  catch(Exception ex)
  {
Console.WriteLine(ex.InnerException.Message);

Ankur Verma
.Net and C++ Specialist
Wiley Tech Support
Reply By: ffbalota Reply Date: 1/8/2004 2:07:13 PM
Tank you Ankur!!!

Fabio Ferreira Balota

Go to topic 8351

Return to index page 973
Return to index page 972
Return to index page 971
Return to index page 970
Return to index page 969
Return to index page 968
Return to index page 967
Return to index page 966
Return to index page 965
Return to index page 964