locked
How do I run Code Analysis on a single project? RRS feed

  • Question

  • I have a solution with a number of projects in it. I want to make a change in a single project and run Code Analysis only on that project. However, when I choose Code Analysis from either the Build menu or right-clicking on the project it goes ahead and run on the whole dependency chain, and therefore takes ages!

    What can I do to persuade it to only analysis one project?
    Thursday, April 12, 2007 10:44 AM

Answers

  • Hmm...this is a tricky one. It might be better in this situation to completely turn Code Analysis off on all the projects and then when you want to run Code Analysis, only run it ad-hocly via:

     

    1. Right-click on a project in Solution Explorer and choose Run Code Analysis.

     

    Regards

     

    David

    Friday, May 4, 2007 4:14 PM
    Moderator

All replies

  • 1) You can turn off code analysis for all other projects.

    2) You can use postbuild event to run FxCope configured with output of your project.

    Thursday, April 12, 2007 12:15 PM
  • Thanks for the reply.

     

    Turning off Code Analysis (CA) for all the other projects is a bit of a hammer to crack a nut. My first thought was that it would be impractical given the 100+ projects I have but then again it does take ages to run CA...and I'd have to make the projects writable (Source Control) to change them, all a bit messy.

     

    The post build event may also a bit messy. Firstly I'm using Code Analysis rather than FxCop but assuming I can get CA to post process the code the whole point it to get the output into the IDE so I can use all the nice tools, such as right-click supress message. If there is a way of doing this via a post build event then please let me know!

     

    Surely I'm just missing some simple hidden menu command or option or something?

     

     

    Friday, April 13, 2007 6:48 AM
  • Hmm...this is a tricky one. It might be better in this situation to completely turn Code Analysis off on all the projects and then when you want to run Code Analysis, only run it ad-hocly via:

     

    1. Right-click on a project in Solution Explorer and choose Run Code Analysis.

     

    Regards

     

    David

    Friday, May 4, 2007 4:14 PM
    Moderator