void Load() { foreach (ServiceProvider item in ServiceProviderConfigSection.GetEntityProvider()) { if (item.Disabled) { break; } if (!string.IsNullOrEmpty(item.AssemblyName)) { string rootPath = string.Empty; try { //if web application rootPath = HttpRuntime.BinDirectory; } catch { //if remoting application rootPath = string.Empty; } try { string fileName = rootPath + item.AssemblyName + ".dll"; if (File.Exists(fileName)) { Assembly assembly = Assembly.LoadFrom(fileName); CollectionEntityMeta(assembly); } } catch (Exception ex) { } } } }
public void FreshService() { if (!IsLoadService) { CollectionService(Assembly.GetExecutingAssembly()); foreach (ServiceProvider item in ServiceProviderConfigSection.GetServiceProvider()) { if (item.Disabled) { break; } if (!string.IsNullOrEmpty(item.AssemblyName)) { string rootPath = string.Empty; try { //if web application rootPath = HttpRuntime.BinDirectory; } catch { //if remoting application rootPath = string.Empty; } try { string fileName = rootPath + item.AssemblyName + ".dll"; if (File.Exists(fileName)) { Assembly assembly = Assembly.LoadFrom(fileName); CollectionService(assembly); } } catch (Exception ex) { } } } IsLoadService = true; } }