Error CA0053 due to failure to load rules DLL when running code analysis - by Jan Huus

Status : 

  External<br /><br />
		This item may be valid but belongs to an external system out of the direct control of this product team.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


9
0
Sign in
to vote
ID 732031 Comments
Status Closed Workarounds
Type Bug Repros 5
Opened 3/19/2012 12:04:16 PM
Access Restriction Public

Description

I installed the Visual Studio 11 Premium beta on a machine that already has a Visual Studio 2010 Premium installation. I opened an existing VS 2010 solution file, and it converted successfully and was able to build. However, when I tried the "Run Code Analysis on Solution" feature, I received a number of error messages such as:

CA0053	Error Running Code Analysis	CA0053 : Unable to load rule assembly 'c:\program files (x86)\microsoft visual studio 10.0\team tools\static analysis tools\fxcop\rules\reliabilityrules.dll': Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

This error message occurred for 14 DLLs, including portabilityrules.dll, performancerules.dll, and securityrules.dll. The path above exists, and it contains the DLLs, but since it is running VS11 I am surprised that it was not looking in the corresponding "...\microsoft visual studio 11.0\..." directory. 

However, the code analysis did run and generate some valid warnings despite these errors.
Sign in to post a comment.
Posted by Microsoft on 3/20/2012 at 10:49 AM
Hello,

Likely the reason that Visual Studio 11 is trying to load .dll’s from the Visual Studio 2010 directory is there was a bug in Visual Studio 2010 where it would sometimes add full path information into the .*proj file for Code Analysis properties, instead of the relative path information. The workaround for this issue is to open the .*proj file in a text editor, and delete any full path information in the <CodeAnalysis*> properties. Visual Studio 11 will then correctly load the 11 versions of the code analysis files, and 2010 will continue to load the 2010 versions of the files.

Best Regards,
Visual Studio Code Analysis Team
Posted by MS-Moderator07 [Feedback Moderator] on 3/19/2012 at 6:49 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by MS-Moderator01 on 3/19/2012 at 12:45 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)