void Aspnetconf_Save(object sender, EventArgs e)
 {
     if (sender is AspNetCoreRunConfiguration config && config.IsDirty)
     {
         launchProfileProvider.SaveLaunchSettings();
     }
 }
Beispiel #2
0
        protected override void Write(IPropertySet pset)
        {
            base.Write(pset);

            pset.SetValue(nameof(ExternalConsole), ExternalConsole, false);
            if (EnvironmentVariables.Count == 1 && EnvironmentVariables.ContainsKey("ASPNETCORE_ENVIRONMENT") && EnvironmentVariables ["ASPNETCORE_ENVIRONMENT"] == "Development")
            {
                pset.RemoveProperty(nameof(EnvironmentVariables));
            }

            if (CurrentProfile == null)
            {
                return;
            }

            CurrentProfile.EnvironmentVariables.Clear();
            foreach (var pair in EnvironmentVariables)
            {
                CurrentProfile.EnvironmentVariables [pair.Key] = pair.Value;
            }

            launchProfileProvider?.SaveLaunchSettings(Profiles.ToSerializableForm());
        }