Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Exception has been thrown by the target of an invocation

Reply
 
Old 10-29-2008   #1 (permalink)
Curious


 
 

Exception has been thrown by the target of an invocation

Hi,

I get the error, "Exception has been thrown by the target of an
invocation", at the last line of code.

Any idea why this happens and how to get it fixed?

Type mySFunction = Type.GetTypeFromProgID("S-
PLUS.rsi.em");

object splusObject =
Activator.CreateInstance(mySFunction);

object[] oArgs = new object[] { 33, 11, 56, 80 };

// Get error, "Exception has been thrown by the target
of an invocation"
splusObject.GetType().InvokeMember("x",
System.Reflection.BindingFlags.SetProperty, null, splusObject, oArgs);

My System SpecsSystem Spec
Old 10-29-2008   #2 (permalink)
Stanimir Stoyanov


 
 

Re: Exception has been thrown by the target of an invocation

There is no way for us to know what is wrong if we do not know what the
called function does. Can you link us to the API or control that you are
using, or at least describe the expected behavior?

In an essence, the error message means that the method you called raised an
exception. If in managed code, it could mean that the exception occurred in
the class contructor.

Hope this helps,
--
Stanimir Stoyanov
http://stoyanoff.info

"Curious" <fir5tsight@xxxxxx> wrote in message
news:93e89e5b-ed3b-4641-8c3a-a2da1cb1f0a8@xxxxxx
Quote:

> Hi,
>
> I get the error, "Exception has been thrown by the target of an
> invocation", at the last line of code.
>
> Any idea why this happens and how to get it fixed?
>
> Type mySFunction = Type.GetTypeFromProgID("S-
> PLUS.rsi.em");
>
> object splusObject =
> Activator.CreateInstance(mySFunction);
>
> object[] oArgs = new object[] { 33, 11, 56, 80 };
>
> // Get error, "Exception has been thrown by the target
> of an invocation"
> splusObject.GetType().InvokeMember("x",
> System.Reflection.BindingFlags.SetProperty, null, splusObject, oArgs);
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Calling WriteError causes PipelineStoppedException to be thrown PowerShell
Help. Getting System.Web.HttpUnhandledException' was thrown. .NET General
Exception stack is corrupt when catching and storing the exception .NET General
Vista Install Error: Exception Unknown Software Exception Vista installation & setup
Function names and invocation PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46