How to Show Line Numbers in Visual Studio 2008

by Updated April 26, 2009

To display line numbers in a Visual Studio.net 2008 code window do the following:

  1. Open Visual Studio.net
  2. On the Menu bar, Select 'Tools' -> 'Options'
  3. 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.
  4. On the right-hand side, in the Display section, put a checkmark next to 'Line numbers'. 
  5. 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.

 


0
0

Add your comment

by Anonymous - Already have an account? Login now!
Your Name:

Comment:
Enter the text you see in the image below
What do you see?
Can't read the image? View a new one.
Your comment will appear after being approved.

Related Posts


The default settings in Visual Studio 2010 Professional do not automatically show the Solution file by default in the Solution Explorer sidebar. This can be a bit of a problem if you are trying to add another project to your existing solution. To get the...  more »

When developing websites or applications in Visual Studio.NET, you sometimes need to have Visual Studio run as an administrator. For instance, if you are developing a Web Application Project that uses IIS7 as the local development server for testing,...  more »