Count the number of lines of code in an ASP.Net Web Application

by Heathesh 3. April 2013 05:39

The requirement was simple, count the number of lines of code in an ASP.Net Web Application including the number of HTML lines. To fulfil this requirement I thought I would whip up a quick console app.

How it works is pretty straight forward:

  1. Get the list of files it needs to do the counts for
  2. Make sure the list of files only includes the relevant file types
  3. Make sure the list skips the ASP.Net generated file types
  4. Skip folders if and when required
  5. Make sure it only counted lines of code and not comments and regions
  6. Generate a CSV file called "output.csv" with the relevant details

All the settings should be self explanatory and found in the app.config file in the project. I've included the source for the app in a zip file and saved it here:

Happy Counting!


Tags: , , ,

Development | .Net

Powered by BlogEngine.NET (with enhancements by Heathesh)
Theme by Mads Kristensen (with tweeks by Heathesh)


Microsoft Certified Professional

Microsoft Certified Technology Specialist

Answer Questions


Tag cloud


<<  September 2017  >>

View posts in large calendar