<p>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?</p>

<p>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?</p>

[{'answer_id': 39715, 'author': 'Luke Girvin', 'author_id': 133, 'author_profile': 'https://Stackoverflow.com/users/133', 'pm_score': 2, 'selected': False, 'text': '<p>If you\'re using C#, take a look at <a href="http://code.msdn.microsoft.com/sourceanalysis" rel="nofollow noreferrer">StyleCop</a>.</p>\n'}, {'answer_id': 39716, 'author': 'brien', 'author_id': 4219, 'author_profile': 'https://Stackoverflow.com/users/4219', 'pm_score': 2, 'selected': False, 'text': "<p>Visual Studio uses the settings in Tools > Options > Text Editor > [your language] > Formatting to set how it auto-formats code.</p>\n\n<p>You can set it up how you like and then use Tools > Import and Export settings to create a .settings file for your team to import and use.  It won't enforce rules, but it will make the default VS behavior the same for everyone.</p>\n"}, {'answer_id': 39721, 'author': 'Xavier Nodet', 'author_id': 4177, 'author_profile': 'https://Stackoverflow.com/users/4177', 'pm_score': 0, 'selected': False, 'text': '<p>An extensive use of <a href="http://www.wholetomato.com/" rel="nofollow noreferrer">Visual Assist</a>\'s snippets (bits of pre-formatted codes) may help...</p>\n'}, {'answer_id': 39729, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 0, 'selected': False, 'text': "<p>I second Luke's answer. StyleCop can help you enforce common coding style across your team. If you want to share formatting rules take a look at ReSharper AFAIK it allows you to export and share this settings. </p>\n"}, {'answer_id': 39736, 'author': 'J.T. Grimes', 'author_id': 1676, 'author_profile': 'https://Stackoverflow.com/users/1676', 'pm_score': 0, 'selected': False, 'text': "<p>Editor settings are stored in the registry, so no luck having a single source for them.  You'll need to go with an external tool to ensure uniformity.</p>\n\n<p>A free, quick solution would be exporting the relevant registry settings and loading them up on everyone's machine.  They'll still be able to change them (and they will -- naughty developers!), but you'll at least have a common starting point.</p>\n"}, {'answer_id': 39745, 'author': 'Kjetil Watnedal', 'author_id': 4116, 'author_profile': 'https://Stackoverflow.com/users/4116', 'pm_score': 1, 'selected': False, 'text': '<p>There is a tool called <a href="http://narrange.sourceforge.net/" rel="nofollow noreferrer">NArrange</a> which will arrange your code. This is particular useful to avoid conflicts in source control systems, but also has several other advantages. Check out the web site.</p>\n'}, {'answer_id': 41600, 'author': 'Brad Tutterow', 'author_id': 308, 'author_profile': 'https://Stackoverflow.com/users/308', 'pm_score': 4, 'selected': True, 'text': '<p><a href="http://stylecop.codeplex.com/" rel="nofollow noreferrer">StyleCop</a>, originally called <a href="http://code.msdn.microsoft.com/sourceanalysis" rel="nofollow noreferrer">"Source Analysis"</a> 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.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n'}, {'answer_id': 1799517, 'author': 'RandomProgrammer', 'author_id': 58864, 'author_profile': 'https://Stackoverflow.com/users/58864', 'pm_score': 0, 'selected': False, 'text': '<p>We use the following tools:</p>\n\n<ul>\n<li><a href="http://code.msdn.microsoft.com/sourceanalysis" rel="nofollow noreferrer">StyleCop</a> (as mentioned before)</li>\n<li><a href="http://www.jetbrains.com/resharper/" rel="nofollow noreferrer">Resharper</a></li>\n<li><a href="http://www.codeplex.com/StyleCopForReSharper" rel="nofollow noreferrer">StyleCop for Resharper</a></li>\n</ul>\n\n<p>The reason we use the latter two is twofold: First you are able to do a <em>Clean Up</em> of your code. This allows you to clean your code in one go and solve all warnings. At least that is what the brochure says. In reality you need to set quite a few settings in Resharper. Have a look at <a href="http://blogs.telerik.com/jordandimitrov/posts/08-12-05/how_to_minimize_stylecop_violations_with_resharper_reformat_code_feature.aspx" rel="nofollow noreferrer">links like this</a> to see how that works. Second: Resharper integrates the Stylecop violations in the source editor. Extremely useful as they are visible while writing code and can therefore be solved on the spot.</p>\n'}, {'answer_id': 1799522, 'author': 'Ian P', 'author_id': 10853, 'author_profile': 'https://Stackoverflow.com/users/10853', 'pm_score': -1, 'selected': False, 'text': '<p><strong>Code Review.</strong></p>\n'}, {'answer_id': 1799590, 'author': 'Keith Williams', 'author_id': 50189, 'author_profile': 'https://Stackoverflow.com/users/50189', 'pm_score': 1, 'selected': False, 'text': '<p>No-one\'s mentioned <a href="http://msdn.microsoft.com/en-us/library/bb245788%28VS.80%29.aspx#vs05idetips_topic5" rel="nofollow noreferrer">Team Settings</a> yet? You just export the desired settings to a network share, then get everyone to map to it. Job\'s a good \'un.</p>\n\n<p>Tools -> Options -> Import and Export Settings, then tick "Use Team Settings"</p>\n'}]
['https://Stackoverflow.com/questions/39712', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4231/']