By default, line numbering is disabled in Visual Studio 2010. To enable, follow these steps:
Step 1:
Open Visual Studio 2010.
Step 2:
Click on Tools from the menus.

Step 3:
Expand Text Editor node,select All Languages sub node.
Step 4:
Check Line numbers under the display section.

Step 5:
Press OK button.
Output
