Monday, April 26, 2010

VS 2010 Code Analysis Issue

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.

1 comment:

escristian said...

Thanks a lot, I wasted a lot of time trying to figure this out