Are you getting the following error when Code Analysis is run on a project with Visual Studio 2010?
“MSBUILD : error : CA0059 : Invalid settings passed to CodeAnalysis task”
For me this was being caused because I had run FxCop on my machine. This lead to an environment variable called “FxCopDir” being created and that pointed to the FxCop install directory. Once I deleted the FxCopDir environment variable and restarted Visual studio, Code Analysis began running properly.
To get to the environment variables, right click and select properties on “My Computer”, On the Advanced tab you will find the “Environment Variables” button. Find and delete FxCopDir variable.