public void AddIns(string ID) { if (HttpContext.Current.Request.HttpMethod == "POST") { AddInManager.CreateAddInAppDomain(ID); AddInManager.LoadAddInDll(ID, ""); } }
public void AddAddIn(string ID, string Path) { try { Path = "G:\\Project\\NET\\DynamicDllLoad\\Plug-inDll\\bin\\Debug\\Plug-inDll.dll"; AddInManager.CreateAddInAppDomain(ID); AddInManager.LoadAddInDll(ID, Path); HttpContext.Current.Response.Write("加载成功!"); } catch (Exception ex) { HttpContext.Current.Response.Write(ex.Message); } }
public void LoadAddIn(List <AddIn> AddIns) { try { foreach (AddIn current in AddIns) { if (current.AppDomainStatus == 1) { string text = ConfigurationManager.AppSettings["AddInPath"].ToString() + "\\" + current.ControllerName + "\\"; if (!Directory.Exists(text)) { throw new Exception("插件路径错误:" + text); } AddInManager.CreateAddInAppDomain(current.ControllerName); AddInManager.LoadAddInDll(current.ControllerName, text + current.DllName); } } } catch (Exception ex) { Log.log(ex.ToString()); } }