Creating delegate from MethodInfo

You’re trying to create a delegate from an instance method, but you’re not passing in a target.

You could use:

Delegate.CreateDelegate(typeof(TestDelagate), this, method);

… or you could make your method static.

(If you need to cope with both kinds of method, you’ll need to do that conditionally, or pass in null as the middle argument.)

Leave a Comment