c# - Can I instantiate a type as 'dynamic' from another AppDomain? -
i'm trying load type different assembly (not known @ build time) 'dynamic' , execute method on type. goal disconnect 'plugin' parent application such there no requirement shared code or common interface type. interface implied way of expected method signature on loaded type. this works: dynamic myobj = assembly.load("myassembly").createinstance("mytype"); myobj.execute(); however load type current appdomain along dependent assemblies. want modify allow me same thing in separate appdomain. this works doesn't make use of dynamic keyword, need know explicit type instantiating able call execute method: var appdomain = appdomain.createdomain(domainname, evidence, setup); var myobj = appdomain.createinstanceandunwrap(assembly, type); typeof(imyinterface).invokemember("execute", bindingflags.invokemethod, null, myobj); this target case , have been trying working: dynamic myobj = ad.createinstanceandunwrap(assembly, type)...