Ad

Visual Studio 2005/2008: How Can You Share/force All Developers To Use The Same Formatting Rules?

- 1 answer

I would like to have all developers on my team to use the same rules for formatting several types of code (ASPX, CSS, JavaScript, C#). Can I have visual studio look to a common place for these rules?

I would like to not rely on export/import settings as that brings many settings along. I (for example) don't care what font colors the developer uses when typing, I just want similar formatting. Can you import a subset of settings?

Ad

Answer

StyleCop, originally called "Source Analysis" is the best choice for C#. The first version was rather inflexible, but after recognizing the value that it provides for the community, Microsoft has opened it up to extensions and customizations. It's a solid tool.

For Visual Studio settings, it's trivial to export a sub-set of your settings into a .settings file and require that other team members import and use these settings.

Like any standards, the tools are only as good as the team members, so it probably goes without saying that you will need team buy-in regardless of what tool you use for enforcement.

Ad
source: stackoverflow.com
Ad