Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An error occurred while calculating code metrics

Issue description

When I tried to run code metrics in Visual Studio 2013 for c# project (Analyze -> Calculate Code Metrics for Solution) I get following error:

"an error occurred while calculating code metrics"

This error occurred even for the newly created project, so it was not related with some reference issues.

Solution

To solve this issue I've executed following command as an Administrator:

regsvr32 "C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VsLangproj.olb"

Conclusion

  • I've verified that this issue is not occurring on newly installed VS 2013 (installer with update 4 included), which means that this could be related with updating to "update 4".
like image 364
Sh4DoV Avatar asked Jan 21 '15 16:01

Sh4DoV


2 Answers

The issue happened due to - few of my Visual Studio projects was referring reference, for which the source was not available, as shown in the image below:

enter image description here

Removing those reference enabled the Code Matrices functionalities to be working again.

like image 186
Ashraf Alam Avatar answered Oct 13 '22 01:10

Ashraf Alam


For users who are using vs2017 15.8 .net core, this is a bug which will be fixed in next release(Dev16). Until then you can use vs2015 or wait for an update.

Click here checkout, this issue on c# roslyn

And pull request which will fix this issue.

like image 33
Payam Khaninejad Avatar answered Oct 13 '22 01:10

Payam Khaninejad