public virtual async Task SaveLaunchSettings() { ILaunchSettingsProvider provider = GetDebugProfileProvider(); if (EnvironmentVariables != null && EnvironmentVariables.Count > 0 && SelectedDebugProfile != null) { SelectedDebugProfile.EnvironmentVariables.Clear(); foreach (NameValuePair kvp in EnvironmentVariables) { SelectedDebugProfile.EnvironmentVariables.Add(kvp.Name, kvp.Value); } } else if (SelectedDebugProfile != null) { SelectedDebugProfile.EnvironmentVariables.Clear(); } await provider.UpdateAndSaveSettingsAsync(CurrentLaunchSettings.ToLaunchSettings()); }
/// <summary> /// Functions which actually does the save of the settings. Persists the changes to the launch settings /// file and configures IIS if needed. /// </summary> public async virtual System.Threading.Tasks.Task SaveLaunchSettings() { ILaunchSettingsProvider provider = GetDebugProfileProvider(); if (EnvironmentVariables != null && EnvironmentVariables.Count > 0 && SelectedDebugProfile != null) { SelectedDebugProfile.EnvironmentVariables.Clear(); foreach (var kvp in EnvironmentVariables) { SelectedDebugProfile.EnvironmentVariables.Add(kvp.Name, kvp.Value); } } else if (SelectedDebugProfile != null) { SelectedDebugProfile.EnvironmentVariables.Clear(); } await provider.UpdateAndSaveSettingsAsync(CurrentLaunchSettings.ToLaunchSettings()).ConfigureAwait(false); }