Assuming the byte array contains the .net assembly (.exe or .dll):
Assembly assembly = AppDomain.Load(yourByteArray) Type typeToExecute = assembly.GetType("ClassName"); Object instance = Activator.CreateInstance(typeToExecute);
Now, if typeToExecute implements an interface known to your caller, you can apply it to this interface and call methods on it:
((MyInterface)instance).methodToInvoke();
ckarras Jun 04 '10 at 19:42 2010-06-04 19:42
source share