Home » Visual Studio

Code Analysis while moving projects from Visual Studio 2008 to Visual Studio 2010


We are in process of moving a large code base from Visual Studio 2008 to Visual Studio 2010. There are numerous solutions each with tens of projects. After migrating the projects, I see that the new projects have successfully created ruleset from the code analysis options selected in the original project. However, I am seeing a lot of Code Analysis errors for the same rules, which seemed to work well in the original project.

Some of the most common CA errors I am seeing in the new projects are

CA2000 : Microsoft.Reliablity - In method "<methodname", object <objectName> is not disposed off in all exception paths.

CA1062: Microsoft.Design - In externally visible method, validate parameters before using it.

There are tens of other errrors like these.

We have a mature code base with all the unit tests working and cannot take the hit of resolving all these projects across solutions.

I want to know if Visual Studio has changed the logic on how these rules are calculated because the same rules pass in the original project. Also, is there is any way we can move retain the rules without actually breaking the project?

Thanks for your help.



5 Answers Found


Answer 1

Yes, the implementation logic for some rules has changed between VS 2008 and VS 2010.  If you don't want to fix the newly detected problems, a reasonable approach would be to create suppressions with justification properties that indicate why you aren't fixing them.

Answer 2

Hi Hamid,

Nicole is correct. Some new rules are added into VS 2010 (Both CA2000 and CA1062 are new rules).

For a complete list of new rules, please refer to John's blog:




Answer 3


We will be doing the same migration activity.

I saw one tool name ArcGIS on net.. How Efficient is it to use this tool.

Or does Visual studio  has some inbuilt tool.

Please let me know the steps for best Migration.



Answer 4

ArcGIS is a product set for representation and management of geospatial data.  While ESRI does provide a .NET API for ArcGIS, this has nothing to do with FxCop/VS Code Analysis or with migration from VS 2008 to VS 2010.

Answer 5

>Nicole is correct. Some new rules are added into VS 2010 (Both CA2000 and CA1062 are new rules).

The situation seems to be that CA2000 is missing in VS2008 - since it existed in VS2005 and is now back again in VS2010.



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure