List Source Command


This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here

Displays the specified lines of source code.


Debug.ListSource [/Count:number] [/Current] [/File:filename]  
[/Line:number] [/ShowLineNumbers:yes|no]  


Optional. Specifies the number of lines to display.

Optional. Shows the current line.

Optional. Path of the file to show. If no filename is specified, the command shows the source code for the line of the current statement.

Optional. Shows a specific line number.

Optional. Specifies whether to display line numbers.



This example lists the source code from line 4 of the file Form1.vb, with line numbers visible.

Debug.ListSource /File:"C:\Visual Studio Projects\Form1.vb" /Line:4 /ShowLineNumbers:yes  

See Also

Visual Studio Commands
Command Window