src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Debug/ProjectDebuggerProvider.cs
/// <summary>
/// Launches the Visual Studio debugger.
/// </summary>
Launches the Visual Studio debugger.
Launches the Visual Studio debugger .
protected async Task<IReadOnlyList<VsDebugTargetProcessInfo>> DoLaunchAsync(params IDebugLaunchSettings[] launchSettings)
        {
            VsDebugTargetInfo4[] launchSettingsNative = launchSettings.Select(GetDebuggerStruct4).ToArray();
            if (launchSettingsNative.Length == 0)
            {
                return Array.Empty<VsDebugTargetProcessInfo>();
            }
            try
            {
                await ThreadingService.SwitchToUIThread();
                IVsDebugger4 shellDebugger = await _vsDebuggerService.GetValueAsync();
                var launchResults = new VsDebugTargetProcessInfo[launchSettingsNative.Length];
                shellDebugger.LaunchDebugTargets4((uint)launchSettingsNative.Length, launchSettingsNative, launchResults);
                return launchResults;
            }
            finally
            {
                foreach (VsDebugTargetInfo4 nativeStruct in launchSettingsNative)
                {
                    FreeVsDebugTargetInfoStruct(nativeStruct);
                }
            }
        }
protected async Task < IReadOnlyList < VsDebugTargetProcessInfo > > DoLaunchAsync ( params IDebugLaunchSettings [ ] launchSettings ) { VsDebugTargetInfo4 [ ] launchSettingsNative = launchSettings . Select ( GetDebuggerStruct4 ) . ToArray ( ) ; if ( launchSettingsNative . Length == 0 ) { return Array . Empty < VsDebugTargetProcessInfo > ( ) ; } try { await ThreadingService . SwitchToUIThread ( ) ; IVsDebugger4 shellDebugger = await _vsDebuggerService . GetValueAsync ( ) ; var launchResults = new VsDebugTargetProcessInfo [ launchSettingsNative . Length ] ; shellDebugger . LaunchDebugTargets4 ( ( uint ) launchSettingsNative . Length , launchSettingsNative , launchResults ) ; return launchResults ; } finally { foreach ( VsDebugTargetInfo4 nativeStruct in launchSettingsNative ) { FreeVsDebugTargetInfoStruct ( nativeStruct ) ; } } }
Launches the Visual Studio debugger.
Launches the Visual Studio debugger .
// The debugger needs to be called on the UI thread // Free up the memory allocated to the (mostly) managed debugger structure.