>Sure you can. Look at the InnerException of the returned Exception. Somewhere in the Exception stack is the real error...
>
>Most likely it's:
>
>You're calling a method that has overloads (in which case you have to pass the parameter types as a type array)
>You don't have permissions to access the method
>The object returned is null in your code <s>
I have found what was causing this. Basically, the situation was that I was not able to get a valid error message but "Exception has been thrown by the target of an invocation.".
To resolve the issue, I have moved the Reflection code that instantiates the object and which does the call to the method inside the same DLL that is doing most of the method calls. So, now, when there is an error, I have the proper error message.
The hierarchy is that I have an executable named Robot.exe which has a reference to Framework.dll.