Total line of code in c# web project

 I have not worked with Visual Studio before ever , I want to know how do I know the total line of code in a C# web project in VS 2015

Best regard
Mashael albarakAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Easiest way is to use the Code Metrics extension, if you're using a paid version of VS. If not, this blog suggests a Find with a regular expression:
Naitik GamitSoftware DeveloperCommented:
Mashael albarakAuthor Commented:
I have VS 2015 community , its free not paid release
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

In my VS2015  Community Edition:

View | Other Windows | Code Metrics Results
Then, in that window, click the "Calculate Code Metrics for Solution" button (at the top left of the bar in the window) and it will calculate the (estimated) number of lines of code in the solution (as well as some other metrics).

The value "... Indicates the approximate number of lines in the code. The count is based on the IL code and is therefore not the exact number of lines in the source code file ...".

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mashael albarakAuthor Commented:
Will it includes also the comments lines ??? Becasue i dont want to include the comments code
>> ... Will it includes also the comments lines ?

I've no idea - but I doubt that comment lines will be included if the value is estimated by examining IL Code.

Try it with a small test solution, and find out (then let the rest of us know the answer!).
Mashael albarakAuthor Commented:
Well thats the problem I dont know how to create a new solution file , this is my first time ever Working with visual studio ,, can someone do me a favour and test if the code metric line of code will include the comments line ???
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I dont know how to create a new solution file
Use File >> New Project. Add a module with a few comment lines, and a function/sub or two, then see what happens.
As far as I'm aware (I use WPF projects, not Web projects), when you add a new project (via File | New | Project) a new Solution (default name based on the project name) is automatically created.
Mashael albarakAuthor Commented:
I' m an oracle database person I dont kknow how to create functions , please help
Mashael albarakAuthor Commented:
Can someone just create a small solutiin file in test if the line of code metric will include the comments
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Can someone just create a small solutiin file in test if the line of code metric will include the comments
This is the trouble with volunteer communities - YOU don't have the time to do it, but you expect US to stop what we're doing and do your job for you.

At most, it would take 5 minutes to create a new solution file, add a module, add a sub/function, and then run the metrics.
Mashael albarakAuthor Commented:
Its not that I dont have the time , its I DONT  KNOW HOW to do it, how to create a function , what to write in the function ??
Visual Studio provides plenty of Help topics, as do other 'programming' web sites.

The best way to learn about something is to do a bit of research, then try something, then a bit more research, ...
Mashael albarakAuthor Commented:
Thank you for your help
The MSDN web site includes hundreds of sample projects to help you on your way - see
You could:

Download one of the sample projects.
Open the project in Visual Studio.
Use the "Calculate the Code Metrics" mechanism to obtain the estimated number of lines of code in the project/solution.
Add a few hundred dummy lines of comment to one or more of the .cs files in the project.
Recalculate the code metrics.
Mashael albarakAuthor Commented:
Ok thank you very much
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

-- DansDadUK (https:#a42083380)
-- DansDadUK (https:#a42083548)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.