how to run StyleCop rules automatically during IDE build

Mar 9, 2012 at 2:09 PM


All --

Please help.

How can one run all StyleCop rules automatically when a build is done in the Visual Studio 2010 IDE.


Here are the details.

Our team's current setup for each workstation is the following...

- Install the latest MSI, (currently "StyleCop-").

- Open the project in Visual Studio.

- Checkout the project file in Visual Studio.

- Right-click on the project in the Solution Explorer, then choose "StyleCop Settings".

- Choose the tab "Settings Files".

- The radio-button "Merge with the following settings file" should be selected; so, if it is not selected, then select it.

- The item "Location" should point the shared settings file as follows...


- Save the project.

- Done.


With that being done... Case A, when we choose >Tools, >Run StyleCop, then all the StyleCop rules do fire...

...BUT... Case B, when we choose >Build, >Rebuild Solution, all the StyleCop rules do not fire...


So the question is how can one cause all the StyleCop rules to run when choosing >Build, >Rebuild Solution?

Please advise.


-- Mark Kamoski

Mar 9, 2012 at 2:13 PM


All --

Please excuse my question above.

I found the answer here...

...and apparently what I was looking for was "StyleCop build integration" but missed that key phrase, etc.


-- Mark Kamoski