Code Metrics is a tool which can be used to find complex and unmaintainable areas within your .NET applications.
In my previous article How to use Code Metrics tool to Count Lines of Code (LOC) in .NET application from Visual Studio, we saw the usage of Code Metrics tool.
This article will be answer to the questions like how to measure C# loc , how to measure vb.net loc etc.
As mentioned in that article this tool will not work directly with Visual Studio Professional edition. But still, we can use Code Metrics with VS professional.
See the step by step procedure for using Code Metrics tool to Count the Lines of Code (LOC) in .NET application from Visual Studio Professional edition.
Count the Lines of Code in .NET application from Visual Studio Professional
Download and Install the Code Metrics Power Tool 10.0 exe from here.
Download and install the Code Metrics Viewer 2010 VsCodeMetrics.msix from here.
1) Go to Visual Studio >> Tools >> Options >> Code Metrics >> Tools
You will see the window as below
2) Go right side of the window and Browse the Code Metrics Power Tool path. This is normally at location
C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop
[ Make sure that you have Metrics.exe inside this folder path ]
3) Select the FxCop and click OK.
4) Open your solution in Visual Studio which you need to analyze using Code Metrics
5) Right-click on the solution and select the context menu option "Code Metrics Viewer".
6) Inside Code Metrics Viewer window Click the Analyze Solution button.
You may be Interested in reading Count the Lines of Code (LOC) in .NET application also
Hope this article helped you in understanding how to measure C# loc and how to count no of lines of any .net application from visual studio professional edition.Leave your feedback in the comment section below.