This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Visual Studio
VS 2005+

Turn On Visual Studio 2005 Line Numbering

Many developer assistance tools, such as Microsoft's 'FxCop' refer to line numbers within source code. Though Visual Studio shows the current line number at all times, finding a referenced line is much easier when source code line numbering is enabled.

Visual Studio Configuration

The grid layout settings are controlled from the standard Visual Studio 2005 options menu. This is also available for the Visual Studio Express Editions such as Microsoft C# Express or Visual Basic Express. To view the options dialog box, select Tools, Options from the menus.

Show All Settings Mode

In some Visual Studio editions the standard options dialog box may be set to view a limited number of settings. If so, you will see only Environment, Text Editor and Debugging within the tree structure. To show all of the settings for Visual Studio, tick the Show all Settings checkbox at the bottom-left of the dialog. The advanced settings will appear.

Text Editor Settings

Once all of the settings are visible, expand the Text Editor branch of the tree. Here you can see a list of all of the languages for which settings may be modified. We will enable line numbering for C# code editing. Expand the C# node of the tree and select the General section to reveal the settings. To enable source code line numbering, tick the appropriate checkbox. Click OK to accept the setting and the line numbers will appear.

Visual Studio Line Numbering Setting

20 October 2006