Bagikan melalui


IVsSolutionBuildManager2.DebugLaunch Method

Launches the startup project specified by the solution as the debug project.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function DebugLaunch ( _
    grfLaunch As UInteger _
) As Integer
int DebugLaunch(
    uint grfLaunch
)
int DebugLaunch(
    [InAttribute] unsigned int grfLaunch
)
abstract DebugLaunch : 
        grfLaunch:uint32 -> int 
function DebugLaunch(
    grfLaunch : uint
) : int

Parameters

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Implements

IVsSolutionBuildManager.DebugLaunch(UInt32)

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsSolutionBuildManager2::DebugLaunch(
   [in] VSDBGLAUNCHFLAGS grfLaunch
);

The solution build manager tracks the startup project or projects that an operation will be performed against when the F5 key is pressed through entries in the Solution Configuration property pages. IVsSolutionBuildManager2 is called by the environment to determine when the F5 key will be enabled. When the environment is in debug mode, it disables the F5 key until either debugging reaches a breakpoint, in which case the F5 key will be enabled with a Continue command, or when debugging stops, in which case the F5 key will be enabled with a Start command.

When F5 is pressed, DebugLaunch will be called by the debug manager component of the environment to begin operation on the startup project or projects. At that point, the environment calls DebugLaunch on the active project configuration of each of the startup projects, which launches a debug session on the project configuration target using project-specific information.

Note

The launched debugger may be a managed or native debug engine from Microsoft, or a custom debugger of your own design as a VSIP developer.

IVsSolutionBuildManager2 knows which project or projects to include in the build process based on the settings in the Solution Configuration property pages, and the individual projects know what needs to be run when the DebugLaunch is called based on the configuration settings as displayed in the Project Configuration property pages. For more information, see Managing Configuration Options.

In some cases, you might want to have a package other than the debugger launch when the F5 key is pressed. In that case your VSPackage, through its implementation of IVsSolutionBuildManager2 and DebugLaunch, determines the startup project or projects against which the package will operate and begin processing.

.NET Framework Security

See Also

Reference

IVsSolutionBuildManager2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace