/// <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.MutableEnvironmentVariables = EnvironmentVariables.CreateDictionary();
            }
            else if (SelectedDebugProfile != null)
            {
                SelectedDebugProfile.MutableEnvironmentVariables = null;
            }
            var globalSettings = provider.CurrentSnapshot.GlobalSettings;
            await provider.UpdateAndSaveSettingsAsync(new LaunchSettings(DebugProfiles, globalSettings, SelectedDebugProfile != null ? SelectedDebugProfile.Name : null)).ConfigureAwait(false);
        }