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.)
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
In Visual Studio 2013 & 2015 :
Tools -> Options -> Text Editor -> All Languages -> check Line Numbers
It's not enabled by default but you can enable it by going to:
settings
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.
In Visual Studio 2010 Express, there is an option called "Show all Settings". Located at "Tools > Options", window.
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.
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.
In VS 2010:
Tools > Settings > Expert Settings
Then:
Tools > Options > Show all settings > Text editor > C# > General > Check Line Numbers (checkbox)