Calculate Code Metrics – Troubleshooting

Project A references B
Code metrics work fine for B. Project A builds OK in Visual Studio. However “Calculate Code Metrics” on project produces error.

Message: An error occurred while calculating code metrics for target file ‘<My Assembly1 path>’ in project <My Assembly1>. The following error was encountered while reading module ‘<My Assembly2>’: Could not resolve member reference: <My Assembly3>.Models.IModel::get_FunctionTable.

SOLVED
It is possible that Code Metrics is using a different reference to Visual Studio. In my particular case my “Common Assemblies” folder had an older reference for Project B. By deleteing the reference from Common Assemblies, Code Metrics was forced to use the more up to date Project Reference, and then worked.

Advertisements