Click here to Skip to main content
15,912,578 members
Home / Discussions / C#
   

C#

 
GeneralRe: operating system Pin
Dave Kreskowiak10-Feb-07 4:04
mveDave Kreskowiak10-Feb-07 4:04 
QuestionDifferent speeds using Pointers Pin
AlexZieg719-Feb-07 21:09
AlexZieg719-Feb-07 21:09 
QuestionMethods and Calling Methods Pin
JMOdom9-Feb-07 20:33
JMOdom9-Feb-07 20:33 
AnswerRe: Methods and Calling Methods Pin
Christian Graus9-Feb-07 21:00
protectorChristian Graus9-Feb-07 21:00 
GeneralRe: Methods and Calling Methods Pin
chris.hagelstein5-Apr-10 8:07
chris.hagelstein5-Apr-10 8:07 
QuestionAccessing dbf database tables instead of database Pin
kalyan_24169-Feb-07 19:36
kalyan_24169-Feb-07 19:36 
QuestionResponse.Redirect Failedon login Pin
dabuskol9-Feb-07 18:14
dabuskol9-Feb-07 18:14 
QuestionException has been thrown by the target of an invocation Pin
Kasic Slobodan9-Feb-07 16:44
Kasic Slobodan9-Feb-07 16:44 
Please help.

I got big problem.

I am working on plugins for my program. Load a list of plugins, double click on certain dll and it shows plugin window.

I have created a plugin and tried to test it, and I get this error: "Exception has been thrown by the target of an invocation"

This is the code that manipulates (calls them) with plugins:

Assembly ass = Assembly.LoadFile(Application.StartupPath + "\\Modules" + lwAddin.SelectedItems[0].SubItems[1].Text + "\\" + lwAddin.SelectedItems[0].Text);

                Object o; Type t;

                string str = lwAddin.SelectedItems[0].Text;
                str = str.Substring(0, str.LastIndexOf("."));
                
                t = ass.GetType(str);
                o = Activator.CreateInstance(t);

                Form frm = ((Form)(o));

                frm.Show();



Variable str is in Namespace.ClassName format and I have test this code above with some sample module (just displays the window) and worked fine, so, I've created this new module, tried and get above error.

That plugin is added to my projects solution as class library project.

What should I do to avoid this?

Thanks in advanced.
AnswerRe: Exception has been thrown by the target of an invocation Pin
Stefan Troschuetz9-Feb-07 21:35
Stefan Troschuetz9-Feb-07 21:35 
GeneralRe: Exception has been thrown by the target of an invocation Pin
Kasic Slobodan11-Feb-07 5:30
Kasic Slobodan11-Feb-07 5:30 
QuestionHow do I Index into a grid view while typing string? Pin
Edwin Smith9-Feb-07 16:12
Edwin Smith9-Feb-07 16:12 
QuestionGripStyle Pin
max292979-Feb-07 15:32
max292979-Feb-07 15:32 
AnswerRe: GripStyle Pin
PIEBALDconsult9-Feb-07 17:00
mvePIEBALDconsult9-Feb-07 17:00 
QuestionMore Options on a ToolStrip Pin
max292979-Feb-07 15:29
max292979-Feb-07 15:29 
QuestionCan I create a personalized window? Pin
Khoramdin9-Feb-07 15:06
Khoramdin9-Feb-07 15:06 
AnswerRe: Can I create a personalized window? Pin
PIEBALDconsult9-Feb-07 17:02
mvePIEBALDconsult9-Feb-07 17:02 
QuestionRe: Can I create a personalized window? Pin
Khoramdin9-Feb-07 22:00
Khoramdin9-Feb-07 22:00 
QuestioncurrentMotion[0]["MeetingDateProp"].ToString("MMM dd, yyyy") Pin
Glen Harvy9-Feb-07 12:06
Glen Harvy9-Feb-07 12:06 
AnswerRe: currentMotion[0]["MeetingDateProp"].ToString("MMM dd, yyyy") Pin
Christian Graus9-Feb-07 12:12
protectorChristian Graus9-Feb-07 12:12 
GeneralRe: currentMotion[0]["MeetingDateProp"].ToString("MMM dd, yyyy") Pin
Glen Harvy9-Feb-07 14:26
Glen Harvy9-Feb-07 14:26 
AnswerRe: currentMotion[0]["MeetingDateProp"].ToString("MMM dd, yyyy") Pin
Ed.Poore9-Feb-07 12:42
Ed.Poore9-Feb-07 12:42 
GeneralRe: currentMotion[0]["MeetingDateProp"].ToString("MMM dd, yyyy") Pin
Glen Harvy9-Feb-07 14:28
Glen Harvy9-Feb-07 14:28 
GeneralRe: currentMotion[0]["MeetingDateProp"].ToString("MMM dd, yyyy") Pin
Ed.Poore9-Feb-07 15:01
Ed.Poore9-Feb-07 15:01 
Question.NET memory limitations Pin
Todd Smith9-Feb-07 11:38
Todd Smith9-Feb-07 11:38 
AnswerRe: .NET memory limitations Pin
Christian Graus9-Feb-07 12:13
protectorChristian Graus9-Feb-07 12:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.