How can I load several assembly and use them? Since when I charge one by means of:
var assemblyBytes = File.ReadAllBytes("ReflectionAssemblyLoadTarget.exe");
var loadMethod = typeof(Assembly).GetMethod("Load", new Type[] { typeof(byte[]) });
var newAssembly = loadMethod.Invoke(null, new object[] { assemblyBytes });
((Assembly)newAssembly).EntryPoint.Invoke(null, new object[] { args });
I charge and call but when I charge several for example:
//Load the bytes as an assembly
Assembly exeAssembly = Assembly.Load(bytes1);
//Execute the assembly
object[] parameters = new object[1]; //Don't know
exeAssembly.EntryPoint.Invoke(null, parameters);
//Load the bytes as an assembly
Assembly exeAssembl = Assembly.Load(bytes2);
//Execute the assembly
object[] parameter = new object[1]; //Don't know
exeAssembl.EntryPoint.Invoke(null, parameter);
Only the first one invokes me but the others do not. Why? What is this about? Can only one assembly be used per program is that why?