Displaying line number in code is important, particularly when doing pair programming. Visual Studio has this feature built in but is turned off by default. Here is how to turn it On.

On the menu bar, choose Tools > Options. In the Option box select Languages > General. And select the Display :- Line number checkbox.

Below is how the line number looks like…

Hope this helps :)