src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Debug/ProjectDebuggerProvider.cs
/// <summary>
/// This is called on F5 to return the list of debug targets. What is returned depends on the debug provider extensions
/// which understands how to launch the currently active profile type. 
/// </summary>
This is called on F5 to return the list of debug targets. What is returned depends on the debug provider extensions
which understands how to launch the currently active profile type.
This is called on F5 to return the list of debug targets . What is returned depends on the debug provider extensions which understands how to launch the currently active profile type .
private async Task<IReadOnlyList<IDebugLaunchSettings>> QueryDebugTargetsInternalAsync(DebugLaunchOptions launchOptions, bool fromDebugLaunch)
        {
            ILaunchSettings currentProfiles = await LaunchSettingsProvider.WaitForFirstSnapshot(5000);
            ILaunchProfile? activeProfile = currentProfiles?.ActiveProfile;
            if (activeProfile == null)
            {
                throw new Exception(VSResources.ActiveLaunchProfileNotFound);
            }
            IDebugProfileLaunchTargetsProvider launchProvider = GetLaunchTargetsProvider(activeProfile) ??
                throw new Exception(string.Format(VSResources.DontKnowHowToRunProfile, activeProfile.Name));
            IReadOnlyList<IDebugLaunchSettings> launchSettings;
            if (fromDebugLaunch && launchProvider is IDebugProfileLaunchTargetsProvider2 launchProvider2)
            {
                launchSettings = await launchProvider2.QueryDebugTargetsForDebugLaunchAsync(launchOptions, activeProfile);
            }
            else
            {
                launchSettings = await launchProvider.QueryDebugTargetsAsync(launchOptions, activeProfile);
            }
            LastLaunchProvider = launchProvider;
            return launchSettings;
        }
private async Task < IReadOnlyList < IDebugLaunchSettings > > QueryDebugTargetsInternalAsync ( DebugLaunchOptions launchOptions , bool fromDebugLaunch ) { ILaunchSettings currentProfiles = await LaunchSettingsProvider . WaitForFirstSnapshot ( 5000 ) ; ILaunchProfile ? activeProfile = currentProfiles ? . ActiveProfile ; if ( activeProfile == null ) { throw new Exception ( VSResources . ActiveLaunchProfileNotFound ) ; } IDebugProfileLaunchTargetsProvider launchProvider = GetLaunchTargetsProvider ( activeProfile ) ?? throw new Exception ( string . Format ( VSResources . DontKnowHowToRunProfile , activeProfile . Name ) ) ; IReadOnlyList < IDebugLaunchSettings > launchSettings ; if ( fromDebugLaunch && launchProvider is IDebugProfileLaunchTargetsProvider2 launchProvider2 ) { launchSettings = await launchProvider2 . QueryDebugTargetsForDebugLaunchAsync ( launchOptions , activeProfile ) ; } else { launchSettings = await launchProvider . QueryDebugTargetsAsync ( launchOptions , activeProfile ) ; } LastLaunchProvider = launchProvider ; return launchSettings ; }
This is called on F5 to return the list of debug targets.
This is called on F5 to return the list of debug targets .
// Get the active debug profile (timeout of 5s, though in reality is should never take this long as even in error conditions // a snapshot is produced). // Should have a profile // Now find the DebugTargets provider for this profile
launchOptions
DebugLaunchOptions
fromDebugLaunch
bool