public static void SaveAppConfig() { try { LOG.Debug("Your current execution value are being automatically saved in the App.Config inside the bin folder. " + "This will help you resume the application or re-do actions again later."); AppConfigWriter.CurrentAppConfig(); if (newRun) { LOG.Debug("The next option is only for first time execution and allows you to save your configuration in the example project's App.config itself. " + "This allows you to retain your configurations across builds or code syncs."); var choice = Utilities.GetUserInput( "Would you like to save your Azure credentials and current run values in the example project's App.Config? (y/n)"); if (choice.Equals("y", StringComparison.OrdinalIgnoreCase)) { AppConfigWriter.CurrentAppConfig(@"..\..\App.config"); } } } catch (Exception ex) { LOG.Warn("Faild to save Azure credentials.", ex); } }
public static void PrepareEHTopologyConfig() { LOG.Info("Preparing SCPHost config for topology submission"); if (!File.Exists(AppConfig.SCPHostConfigFilePath)) { var message = String.Format("Cannot find SCPHost.exe.config. Path: {0}", AppConfig.SCPHostConfigFilePath); LOG.Error(message); throw new ApplicationException(message); } LOG.Info("Creating backup of SCPHost config"); File.Copy(AppConfig.SCPHostConfigFilePath, AppConfig.SCPHostConfigFilePath + ".bak", true); //Update the config in project and also update in bin dir AppConfigWriter.UpdateSCPHostConfig( //AppConfig.SCPHostConfigFilePath, Path.Combine(AppConfig.SCPNetTopologyProjectBinPath, AppConfig.SCPHostConfigFilename)); }