StyleCop Example Custom Rule Project

13 Nov 2013 | Less than one-minute read


A project I’m working on uses StyleCop to automatically enforce a set of style and consistency rules. It took some time for me to get a project setup because the StyleCop SDK is missing a few details. Until I got this right, my rules were never loaded, even if the DLL itself was loaded.

If you have those setup, then the rest of the guide works correctly.

I also put together an example project that has everything setup correctly in case someone wants to start with that. To use the project

Loading the rules should show the custom rule.

Note This project works with StyleCop 4.7. To use with a different version, you will need to update the Reference to point to the right version.