Here, we run a set of Visual Studio 2008’s CA rules both locally and on the build server. In order to check in, our CA rules must match the servers policy. However, I work on a large solution with several projects. Building the project in release mode takes a long time with the CA rules enabled, but this is necessary when creating or editing unit tests. This makes working with unit tests a painful task. What I’d like to do is to have a quick way (quicker than going through all projects to disable CA) to disable the CA rules during development, and then re-enable them on before checking in. Does anyone know if this is possible?
Share
I usually create a “Debug No FxCop” build configuration at the solution level for this, with the only difference between the within-project configurations being the RunCodeAnalysis property that Graham has already mentioned. Using a build configuration for this will allow you to avoid reloading your solution when you want to switch between CA and non-CA modes.