private static void RunOnConfigDefault(IConfigItem configItem) { CrmServiceClient client = GetConnection(configItem); AssemblyLoaderCrm loader = new AssemblyLoaderCrm(new ConsoleLog(), configItem.Path, client, configItem.IsolationMode, configItem.SourceType); loader.Run(); }
private void Deployment(object obj) { try { OutputWindowHelper.Log("Deployment Start.."); CrmServiceClient client = GetConnection(SelectedConfig); AssemblyLoaderCrm loader = new AssemblyLoaderCrm(new OutputLog(), GetPath(SelectedConfig.Path), client, SelectedConfig.IsolationMode, SelectedConfig.SourceType); loader.Run(); _configReader.Save(Configs.ToDictionary(k => k.Name, v => (IConfigItem)v)); } catch (Exception ex) { OutputWindowHelper.Log(ex.Message); OutputWindowHelper.Log(ex.ToString()); throw; } finally { OutputWindowHelper.Log("Deployment Stop.."); CloseRequest?.Invoke(false); } }
private static void RunOptionsAndReturnExitCode(Options opts) { CrmServiceClient client; string path; IsolationMode isolationMode; SourceType sourceType; if (!string.IsNullOrWhiteSpace(opts.ConfigurationElement)) { ConfigReader reader = new ConfigReader(new ConsoleLog()); IDictionary <string, IConfigItem> configs = reader.Read(); if (configs == null || configs.Count <= 0) { throw new ApplicationException("Missing COnfiguration when argument switchconfig present"); } if (!configs.ContainsKey(opts.ConfigurationElement)) { throw new ApplicationException($"Missing Configuration elment:{opts.ConfigurationElement} when argument switchconfig present"); } IConfigItem config = configs[opts.ConfigurationElement]; client = GetConnection(config); path = GetPath(config.Path); isolationMode = config.IsolationMode; sourceType = config.SourceType; } else { client = GetConnection(opts); path = GetPath(opts.DllPath); isolationMode = opts.IsolationMode; sourceType = opts.SourceType; } AssemblyLoaderCrm loader = new AssemblyLoaderCrm(new ConsoleLog(), path, client, isolationMode, sourceType); loader.Run(); }