How to Show Line Numbers in Visual Studio 2008
by
Doug
Updated April 26, 2009
Turn on line numbers for 'All Languages' in Visual Studio.net 2008.
You can turn on line numbers individually for various languages like Javascript, T-SQL and XML.
To display line numbers in a Visual Studio.net 2008 code window do the following:
- Open Visual Studio.net
- On the Menu bar, Select 'Tools' -> 'Options'
- In the Options pop-up window, Select 'Text Editor' -> 'All Languages' > 'General'. Note: If you don't see 'Text Editor' in the left-hand menu, look in the lower left corner of the Options pop-up window and make sure the 'Show all settings' checkbox is checked.
- On the right-hand side, in the Display section, put a checkmark next to 'Line numbers'.
- Click the 'OK' button.
Keep in mind, if 'Line numbers' was already checked / filled-in and you want to be sure All languages will display line numbers, then unselect the 'Line numbers' checkbox, and then re-check 'Line numbers' and click 'OK'. Otherwise, some languages may not have line numbers turned on.
If you don't want to have 'All Languages' show line numbers you can also select each language individually and have its 'Line Numbers' turned on, which may not have been turned on by default. In my case, I turned line numbers on for JScript, T-SQL, and XML separately.