Line numbers are not displayed by default in most Visual Studio installations. To activate it, select Options… in the Tools menu.
Now expand the Text Editor section of the Options dialog box and click All languages. Then just check the Line number box in the screen section.
When you open a file, you should see the line numbers in the text editor.
Note that the screenshots in this example use Visual Studio 2010, but these steps also apply to many earlier versions.
Category: Development, Visual Studio, USA 2010
show line number in visual studio code,how to show line number in vi