Code metrics for RhinoCommon Plugin

Hi everyone!

I want to calculate code metrics for plugin project we are developing with rhinocommon library and visual studio, but when I try to analyze code metrics below error message returns:

Message: No code metrics are available for this project because because the target file ‘C:\path\to\plugin\bin\pluginProjectName.dll’ is missing. Please rebuild the project and calculate code metrics again.

I rebuild the project but still same error appears. Did anyone managed to calculate code metrics for plugin project? How to do that? Thanks!

Tahirhan

probably because, when you build it, the post-build events from the RhinoCommon package thingy changes your .dll into a .rhp file, so after you built it, there is no .dll. You can manually copy/rename the .rhp to .dll or make a new post-build entry and do the same. Dont know if the metric work this way however, as I belive they target the wrong file(the .dll while the .rhp gets executed).

Sorry for the premium english, but its friday afternoon…

Hi @rgr I’m used to that premium english so never mind :slight_smile: I copied the rhp file and saved as a dll file. After that I clicked on analyze code metrics but dll file disappeared automatically, still same :slight_smile: Thanks for the suggestion !

Tahirhan

If analyze code runs the build, it will also run the post-build events. You have to modify them not to delete/rename the .dll but instead make a copy. Maybe this will work.

Hi @tahirhan, If you right click on your Project and go to properties, and then build events, you can find Post-build event command line, probably something like this. Just delete the last line from it
image

1 Like

Thank you @Darryl_Menezes! Removing the “erase” part from the Post-build event worked.