views:

35

answers:

1

Is there a way to export settings for C# formatting at a project level so that we can put the settings file on a repository and everyone can use it without affecting other projects that are using different formatting styles?

+1  A: 
  • For Visual Studio C# environment settings, you can Export them from Tools->Import and Export Settings->Export Selected Environment Settings, then save the file.

    You can store this file somewhere on the network, in Source Safe or TFS.

    Then the other devs who want to use those settings will Import them Tools->Import and Export Settings->Import Select Environment Settings, select the file and press import.

  • It can also be loaded from command line, or a desktop shortcut

     Devenv.exe "C:\MySolution.sln" /ResetSettings "C:\MySettings.vssettings"
    
  • Consider the Code Analysis Policy Editor in Check-In Policies.

  • If what you are looking for is not built in, you might need to look for an Add-in, CodePlex has over 500 of them. If you don't find it, you might have to make Make one.

  • Another possible solution is to bring the teams together in a coding standard meeting where they can agree on a common coding standard, then use a tool like CodeIt.Right to do the code refactoring automatically.

GenEric35
That will change the settings of visual studio and not just for that project though. If you try to open a different project it will still be using the settings that you imported. Is there a way to have it at a project level so that it only affects that one project?
MikeU
by Team Project then, and the settings are Visual Studio environment settings, right? Why does each of your Team Projects need to have their own environment settings?
GenEric35
Some of the developers work on different projects and each project has different developers working on it. Sometimes each team has their own set of coding standards that they want to use. So we don't want to keep changing the settings every time we decide to work on a different project.
MikeU