Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do you count the lines of code in a Visual Studio solution?

is there any scripts or code for that?
Posted
Comments
Maciej Los 7-Jun-12 3:18am    
Do you want to count each line (take a look at the right bottom corner of MS Visual Studio window) or do you want to count only lines with text?
MacParekh 7-Jun-12 6:25am    
i want total line of all pages ?

Why not just look at the screen?
If you go to the last line in the file with CTRL+END it shows you the line number on the status bar...
Or press CTRL-G and the "Go to line" box shows you how many lines there are...
 
Share this answer
 
Comments
MacParekh 7-Jun-12 6:25am    
I want total line of all pages of code
OriginalGriff 7-Jun-12 6:34am    
If you mean "I want the number of lines in all files in my project or solution" then that is not a sensible (or indeed useful) number: What if it is WPF? Do you count XAML file lines? What about .designer.cs lines? Do they count?
If all you want to to count text lines in files, then doing it within VS is a bit silly - it is a lot easier to write a simple app to do it externally (or find an existing one on the internet).
Please refer the Visual Studio addin given in this CodeProject article
Line Counter - Writing a Visual Studio 2005 & 2008 Add-In[^]

As shown in the article this addin counts the Code lines, Comment lines, Total lines etc for each file and also project wise.

I think it may be helpful to you.
 
Share this answer
 
Comments
Maciej Los 7-Jun-12 3:32am    
BIG 5!
VJ Reddy 7-Jun-12 3:38am    
Thank you, losmac :)
did you mean that how can we view the line no. in VS ??
then goto tools-->options-->click on the TextEditor then on All Languages, check the text boxes below display heading.
hope this was what you wanted to know...?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900