Breakpoint.FileLine Property


Indicates the line location within a file for a breakpoint.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

int FileLine { get; }

Property Value

Type: System.Int32

An integer that represents the line number in the source code, measured from the start of the function, at which the breakpoint is set.

If the return value is 1, the breakpoint is set at the start of the file. This is specified in the Line box of the File, New Breakpoint dialog box.

The following example demonstrates how to use the FileLine property.

public static void FileLine(DTE dte)
    // Setup debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("FileLine Property Test: ");

    EnvDTE.Debugger debugger = (EnvDTE.Debugger)dte.Debugger;
    owp.OutputString("Breakpoint in the file " + debugger.Breakpoints.Item(1).File);
    owp.OutputString(" on line " + 
                     debugger.Breakpoints.Item(1).FileLine.ToString() + " column ");
    owp.OutputString(debugger.Breakpoints.Item(1).FileColumn.ToString() + " is ");
    owp.OutputString(debugger.Breakpoints.Item(1).Enabled ? "enabled." : "disabled.");
    owp.OutputString("\nThis breakpoint is in the function: " + 
Return to top