Visual Studio 2010 Code Metrics Fail
-
2012年2月28日 13:50
I have a .Net 2 project that compiles, builds and runs. It has 20 projects, with the goal being a Winforms application. Getting code metrics for every project works except the big one (the application). When it fails, it gives this error:
Message: An error occurred while calculating code metrics for target file <My executable> in project <WinformsApp>. The following error was encountered while reading module <SmallLibrary> Could not resolve type reference <Small Class that Does one thing>
The small class has only one method - a 10 line static. I commented out the contents of the class (which is used in many places, so I can't remove the class). It still failed.
I placed the small class inside <WinformsApp> and removed it from <SmallLibrary> and the code metrics still failed.
I googled this error and found one reference - to a sharepoint project which implied that it was a VS2008 bug wherein references didn't trickle up. So I made sure that <WinformsApp> referenced <SmallLibrary> and all of <SmallLibrary>'s references DIRECTLY. No change.
Any thoughts?
全部回复
-
2012年2月29日 14:11
Could you please provide a small repro code base (à la http://www.yoda.arachsys.com/csharp/complete.html). Given the description you have given, it's rather difficult to try to figure out where the problem might lie.
-
2012年3月1日 2:36版主
Hi mphipps1,
Thank you for posting in the MSDN forum.
I agree with Nicole’s suggestion, since it is hard for us to repro this project, so if possible, you can share us a simple project, and we will try to check it.
In addition, based on your description,
“Message: An error occurred while calculating code metrics for target file <My executable> in project <WinformsApp>. The following error was encountered while reading module <SmallLibrary> Could not resolve type reference <Small Class that Does one thing>”
It seems that it is related to referenced assemblies, I find two threads about the member reference error.
See:
http://social.msdn.microsoft.com/Forums/en-US/vstscode/thread/40b11852-9288-4a07-9967-c4b1c69a0edc/
http://social.msdn.microsoft.com/Forums/en/vstscode/thread/8428f050-5493-4540-a94c-a42fa1552e0f. Hope it can provide useful information.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
- 已编辑 Jack Zhai - MSFTMicrosoft Contingent Staff, Moderator 2012年3月6日 2:26
- 已标记为答案 Jack Zhai - MSFTMicrosoft Contingent Staff, Moderator 2012年3月8日 3:36
-
2012年3月6日 2:28版主
Hi mphipps1,
I am writing to check the status of the issue on your side.
What about this problem now?
Would you mind letting us know the result of the suggestion?
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us

