/// <summary> /// 利用处理器信息封装制造对象 /// </summary> /// <param name="useCommandPacker"></param> /// <returns></returns> private object CreatObjByHandlerInfo(HandlerInfoPacker useCommandPacker) { //加载目标程序集 var loadedAssembly = AssemblyLoadUtility.LoadAssembly(useCommandPacker.StrUseAssemblePath); //获取目标类 var useType = loadedAssembly.GetType(useCommandPacker.StrUseClassFullName); //调用无参方法创建对象 var tempCommandObj = Activator.CreateInstance(useType); return(tempCommandObj); }
/// <summary> /// 程序集解析事件 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> /// <returns></returns> private static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { var returnValue = AssemblyLoadUtility.LoadAssembly(args); return(returnValue); }