How To Count Lines of Code in Visual Studio C#/c++/VB .Net
Many others like myself who do not own a very expencive Enterprise version of Visual Studio want to know how we can quickly work out roughly how many lines of code we have in our project.
Now there is a way!
This is however not the best way of doing it but a cheeky little trick using Find & Replace.
Many people will go on to moan about how code lines are not a way of measuring workload or project deadlines but this post is not about that. It is about finding out that wonderfull growing number 
- Open Visual Studio
- Load your project
- Select Edit -> Find & Replace -> Find in files
- Check Use and select Regular Expressions.
- Type the following in the "Find What" field
for C#
^~(:Wh@//.+)~(:Wh@\{:Wh@)~(:Wh@\}:Wh@)~(:Wh@/#).+
for VB.NET (thanks Steve for the info!)
^~(:Wh@'.+)~(:Wh@/#).+
Select where you want to do the search. Remember: If you select the Current Project or Entire Solution you need to specify the file types that will be included in the search! Eg, .css .cs .xsd etc

Now click on Search and at the bottom of the Find resultd window you will see the total line count in your search!
This REGEX which is used does not find COMMENT lines (//)
Thank you go German Schauger for spreading this great information!
Enjoy and spread the word!
Steve,