Search code examples
c#.netstylecop

Which are the differences between StyleCop and Code Analysis when talking about the rules of each?


Could you please tell me which are the differences between rules of StyleCop and Code Analysis ? Should it be used together or not ?

Thanks.


Solution

  • Style cop essentially parses the file looking for formatting issues and other things that you could think of as "cosmetic". Code analysis actually builds your code and inspects the compiled runtime IL for characteristics about how it behaves when it runs and flag potential runtime problems.

    So, they are complimentary, and you are perfectly fine to use them together.