Click here to Skip to main content
15,917,731 members
Home / Discussions / C#
   

C#

 
GeneralRe: events on PocketPc's Pin
Heath Stewart3-Sep-04 6:17
protectorHeath Stewart3-Sep-04 6:17 
GeneralRe: events on PocketPc's Pin
Not Active26-Aug-04 13:03
mentorNot Active26-Aug-04 13:03 
GeneralRe: events on PocketPc's Pin
Heath Stewart26-Aug-04 13:19
protectorHeath Stewart26-Aug-04 13:19 
GeneralRe: events on PocketPc's Pin
pat27088126-Aug-04 22:32
pat27088126-Aug-04 22:32 
GeneralProfiler for 2.0 Pin
Judah Gabriel Himango26-Aug-04 5:32
sponsorJudah Gabriel Himango26-Aug-04 5:32 
GeneralTutorial on using writing report in C# Pin
steve_rm26-Aug-04 4:16
steve_rm26-Aug-04 4:16 
GeneralRe: Tutorial on using writing report in C# Pin
Heath Stewart26-Aug-04 8:34
protectorHeath Stewart26-Aug-04 8:34 
GeneralCalling a method at run-time Pin
Radoslav Bielik26-Aug-04 3:01
Radoslav Bielik26-Aug-04 3:01 
Hi everyone,

I'm not sure if the title of this thread is good. Smile | :) This is what I'm trying to achieve: I would like to call a static method of a class in a separate assembly based on a string parameter containing the name of the class and method.

I already figured out the basics, this is the code I'm using.

Type MyType=Type.GetType("TestPlugin.TestPluginClass,TestPlugin");
if(MyType!=null)
{
	MethodInfo mi=MyType.GetMethod("PluginMethod");
	if(mi!=null)
		mi.Invoke(null, null);
}


The problem is that this only works when the calling assembly is compiled with reference to the target assembly (TestPlugin in this case). I guess that I'll have to load the target assembly somehow to make it work this way. How can this be achieved?

Thanks for any ideas! Smile | :)

Rado




Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll

GeneralRe: Calling a method at run-time Pin
Not Active26-Aug-04 3:15
mentorNot Active26-Aug-04 3:15 
GeneralRe: Calling a method at run-time Pin
Heath Stewart26-Aug-04 8:22
protectorHeath Stewart26-Aug-04 8:22 
GeneralRe: Calling a method at run-time Pin
LongRange.Shooter26-Aug-04 3:52
LongRange.Shooter26-Aug-04 3:52 
GeneralRe: Calling a method at run-time Pin
Radoslav Bielik26-Aug-04 22:06
Radoslav Bielik26-Aug-04 22:06 
GeneralRe: Calling a method at run-time Pin
Brian Delahunty26-Aug-04 5:27
Brian Delahunty26-Aug-04 5:27 
GeneralRe: Calling a method at run-time Pin
leppie26-Aug-04 7:36
leppie26-Aug-04 7:36 
GeneralRe: Calling a method at run-time Pin
Heath Stewart26-Aug-04 8:26
protectorHeath Stewart26-Aug-04 8:26 
GeneralRe: Calling a method at run-time Pin
leppie26-Aug-04 9:21
leppie26-Aug-04 9:21 
GeneralRe: Calling a method at run-time Pin
Heath Stewart26-Aug-04 8:32
protectorHeath Stewart26-Aug-04 8:32 
GeneralRe: Calling a method at run-time Pin
LongRange.Shooter26-Aug-04 10:22
LongRange.Shooter26-Aug-04 10:22 
GeneralRe: Calling a method at run-time Pin
Heath Stewart26-Aug-04 10:31
protectorHeath Stewart26-Aug-04 10:31 
GeneralRe: Calling a method at run-time Pin
Radoslav Bielik26-Aug-04 22:10
Radoslav Bielik26-Aug-04 22:10 
GeneralSeparate repeated items Pin
Diego F.26-Aug-04 1:58
Diego F.26-Aug-04 1:58 
GeneralRe: Separate repeated items Pin
LongRange.Shooter26-Aug-04 3:54
LongRange.Shooter26-Aug-04 3:54 
GeneralRe: Separate repeated items Pin
Diego F.26-Aug-04 4:51
Diego F.26-Aug-04 4:51 
GeneralRe: Separate repeated items Pin
LongRange.Shooter26-Aug-04 10:17
LongRange.Shooter26-Aug-04 10:17 
GeneralAccessing the .Net command prompt Pin
Stuggo26-Aug-04 1:46
Stuggo26-Aug-04 1:46 

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.