private static string GetPluginTypeName(AppDomain domain, string pluginPath) { PluginAppDomainHelper helper = null; var pluginFinderType = typeof(PluginAppDomainHelper); if (!string.IsNullOrEmpty(pluginFinderType.FullName)) { helper = domain.CreateInstanceAndUnwrap(pluginFinderType.Assembly.FullName, pluginFinderType.FullName, false, BindingFlags.CreateInstance, null, new object[] { pluginPath }, null, null) as PluginAppDomainHelper; } if (helper == null) { throw new Exception("Couldn't create plugin domain helper"); } return(helper.PluginTypeName); }
private static string GetPluginTypeName(AppDomain domain, string pluginPath, string jobName) { PluginAppDomainHelper helper = null; var pluginFinderType = typeof(PluginAppDomainHelper); if (!string.IsNullOrEmpty(pluginFinderType.FullName)) { helper = domain.CreateInstanceAndUnwrap(pluginFinderType.Assembly.FullName, pluginFinderType.FullName, false, BindingFlags.CreateInstance, null, new object[] { pluginPath }, null, null) as PluginAppDomainHelper; } if (helper == null) { Logger.ErrorFormat("Error in AssemblyPluginJob ({0}): Could not create plugin domain helper.", jobName); throw new JobExecutionException("Could not create plugin domain helper"); } return(helper.PluginTypeName); }