dotnet / dotnet/project-system
Provide access to previously selected launch profile
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
We'd like our extension to interact with launch profiles such that if the user selects our custom launch profile, our logic can reset the selected profile back to the previously selected profile if the user decides to cancel the operation. That's because when our custom launch profile is selected, we prompt the user with a dialog to gather some required data. The user then has the option of canceling that dialog in which case we want to revert the profile selection and switch it back to the previous profile.
Normally, this can be done by implementing our own logic that tracks changes to the launch profile so we always know what the previously selected profile is. But with the proposed feature in #4327, this isn't possible because our assembly wouldn't have been loaded in time to track what the previously selected launch profile was.
So the proposal is to add a property to ILaunchSettings that exposes this state:
```
ILaunchProfile PreviousProfile { get; }
```
We can then use that property and reset the active profile by calling ILaunchSettingsProvider.SetActiveProfileAsync.
Contributor guide
Assessment
This issue has not been assessed yet.