Code analysis CA0053 building VS 2010 projects in VS 2012

by Rob 15. September 2012 11:16

I've been slowly migrating to using VS2012 as my primary development environment and I love the fact that it can open projects created in 2010 with no conversion required. It is however, not flawless as I found when trying to build a project with code contracts and code analysis enabled. The build fails with warnings from code analysis like so;

The problem is that VS2010 puts an absolute path into the project file for the code analysis rule files (bug?) and this causes 2012 to attempt to load the 2010 versions and subsequently fail.

This appears to be reasonably well documented on the internet and a post on this problem with a fix is available here. The author claims the fix will last as long as you don't add any new configurations but in my experience I've seen the issue magically come back after the customer subsequently worked on the project with VS2010 and added no new configurations.

Tags: ,

Development

Comments (2) -

Terje Sandstrom
Terje Sandstrom Norway
9/26/2012 9:17:32 PM #

Hi!  
Interesting to learn you have seen more ways it can change back to the wrong setting.  I did notice the config changes, and it seemed that was what would cause the changes.  But I am not surprised there can be more ways this can happen.  I will update the blog post with this information.   If there are more reports like this, the tool could perhaps be made into a VS extensions, right click the solution, and choose "Fix CA0053".  

best regards
Terje Sandstrom
(the "author" referred to above)

Rob
Rob United Kingdom
9/27/2012 8:35:55 AM #

Hi Terje,

Yes it doesn't surprise me either; Unfortunately I don't know exactly what the customer did to make it reset. To be honest it could be something not directly Visual Studio related such as a source control merge misbehaving but even so, it is still a potential scenario in which it can come back.

By the way - nice tool, I'd have used it if I had had any more projects to convert but it looks like for some reason this was the only customer affected so far.

Comments are closed

About the author

Rob has been involved with software development since his early teens. Starting out with BASIC programming on the ZX81 and Atari ST, before moving to IBM compatible machines primarily using the Microsoft tool chain.

He has experience in many areas of development, such as line of business (LOB) applications, games, web applications and mobile devices.

He currently leads a dual life as both a freelance software engineer providing expertise and software solutions to numerous companies in the UK, as well as the lead developer for a global telecommunications company.

Month List

Page List