Enable the display of line numbers in Visual Studio

Visual Studio-2010Visual StudioLine Numbers

Visual Studio-2010 Problem Overview


Why doesn't Visual Studio have any way of showing line numbers in a source file? Is there any way to enable it, or a plugin for it? I know that the number of lines of code in a program doesn't matter, but sometimes it is nice to know how long a program is or the number of a particular line for reference.

Though I tried, I can't seem to find a way to enable line numbering and I find that surprising.

This is Visual Studio 2010 Ultimate. (If you have read my older questions, I've been using 2008 Express until now.)

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

Visual Studio has line numbering:

Tools -> Options -> Text Editor -> All Languages -> check the "Line numbers" checkbox.

Solution 2 - Visual Studio-2010

As of Visual Studio 2015, you can find the option under:

Tools-> Options -> Text Editor -> All Languages-> General -> Line Numbers

Visual Studio 2013 Line Numbers Option Menu


Or simply go to tools -> options and type on the search bar: "Numbers".

Solution 3 - Visual Studio-2010

Tools -> Options -> Show All Settings -> Text Editor -> All Languages -> Line Numbers

Solution 4 - Visual Studio-2010

In Visual Studio 2013 & 2015 :

Tools -> Options -> Text Editor -> All Languages -> check Line Numbers enter image description here

Solution 5 - Visual Studio-2010

It's not enabled by default but you can enable it by going to:

  1. Click Tools
  2. Options
  3. Text Editor (expand)
  4. All Languages
  5. Line Numbers (Checkbox)
  6. Click Ok

settings

Solution 6 - Visual Studio-2010

In VS 2010:

Tools > Settings > Expert Settings

Then:

Tools > Options > Show all settings > Text editor > C# > General > Check Line Numbers (checkbox)

Solution 7 - Visual Studio-2010

Options -> Text Editor -> All Languages -> Line Number checkbox enter image description here

Solution 8 - Visual Studio-2010

Visual studio 2015 enterprice

Tools -> Options -> Text Editor -> All Languages -> check Line Numbers

https://msdn.microsoft.com/en-us/library/ms165340.aspx[![enter image description here]1]1

Solution 9 - Visual Studio-2010

Are you talking about seeing the line numbers or knowing the total number of lines in a project? Here is the 1st one

Solution 10 - Visual Studio-2010

Line numbers are not on by default. To turn on line numbers just go to Tools -> Options -> Text Editor -> All Languages -> General -> Display and check Line numbers:

http://blogs.msdn.com/blogfiles/zainnab/WindowsLiveWriter/TurnonLineNumbers_A5E7/image_thumb.png

Solution 11 - Visual Studio-2010

For me, line numbers wouldn't appear in the editor until I added the option under both the "all languages" pane, and the language I was working under (C# etc)... screen capture showing editor options

Solution 12 - Visual Studio-2010

Type 'line numbers' into the Quick Launch textbox (top right VS 2015), and it'll take you right where you need to be (tick Line Numbers checkbox).

Solution 13 - Visual Studio-2010

For MS Visual Studio 2015 type "Text" in Quick Launch (Ctrl+Q) of top right corner.

  1. quicklaunch

  2. In the list select Text Editor->All Languages->General select_allLanguages

  3. Now check on "Line Numbers" and click OK to get the line numbers.

Finally we get the line number in text editor.

Solution 14 - Visual Studio-2010

In Visual Studio 2010 Express, there is an option called "Show all Settings". Located at "Tools > Options", window.

enter image description here

If this option is not checked, the line number option will not be available. Make sure this option is checked like shown below. This will make lot of additional settings visible in the tree view to the left.

enter image description here

Now this will make the option "Tools > Options > Text Editor > C# > General > Line Editor" available. Check the "Line Number" option to make line numbers visible on Visual Studio 2010 Express.

enter image description here

Solution 15 - Visual Studio-2010

You should edit "settings.json". In that add, "editor.lineNumbers":"on", . You can check comments for various options you have.

In Visual Studio Code - 2017, you can also directly go to a given line number. There are following three ways to do that.

  1. Directly use keyboard shortcut - Ctrl + G.
  2. Under menu Go, use Go to Line - Go > Go to Line
  3. Search for Go to Line in Command Pallete (Cmd + Shift + P).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCycloneView Question on Stackoverflow
Solution 1 - Visual Studio-2010James McNellisView Answer on Stackoverflow
Solution 2 - Visual Studio-20100x6C38View Answer on Stackoverflow
Solution 3 - Visual Studio-2010CycloneView Answer on Stackoverflow
Solution 4 - Visual Studio-2010Abdessamad DoughriView Answer on Stackoverflow
Solution 5 - Visual Studio-2010Dmitri LarionovView Answer on Stackoverflow
Solution 6 - Visual Studio-2010Ya BashaView Answer on Stackoverflow
Solution 7 - Visual Studio-2010WesamView Answer on Stackoverflow
Solution 8 - Visual Studio-2010Sherif HamdyView Answer on Stackoverflow
Solution 9 - Visual Studio-2010Martin MarconciniView Answer on Stackoverflow
Solution 10 - Visual Studio-2010User001View Answer on Stackoverflow
Solution 11 - Visual Studio-2010Crux161View Answer on Stackoverflow
Solution 12 - Visual Studio-2010Seba IllingworthView Answer on Stackoverflow
Solution 13 - Visual Studio-2010user337826View Answer on Stackoverflow
Solution 14 - Visual Studio-2010Ganesh Kamath - 'Code Frenzy'View Answer on Stackoverflow
Solution 15 - Visual Studio-2010Saurabh VermaView Answer on Stackoverflow