Skip to main content
All docs
V22.2

How to: Share CodeRush Settings with a Team

  • 2 minutes to read

The Options Layers feature allows you to share CodeRush options between developers in your team. This example shows how to share the “h1” code template defined for your solution.

Create a Template

  1. Open your solution in Visual Studio.

  2. Select the “CodeRush | Code Templates…” item in Visual Studio’s menu to open the templates options page.

    Code Templates Page

  3. Click the “New Category” toolbar button.

    Click New Category

  4. In the “New Category” dialog, enter the “Team Templates” category name, check the “Make this a top-level folder” check box, and click OK to create the “Team templates” category.

    Specify Category

  5. Right-click the newly added category and select “New Template”

    Right Click Template Category

  6. In the “New Template” dialog, enter the “t1” template name and click OK.

    Template Dialog

  7. Select the “t1” template and enter the following code in the expansion editor:

    public class MyTeamTemplate { }  
    

You can enter your own template text in the expansion editor. For more information on custom templates creation, refer to the following documentation section: Custom Templates Creation.

Save New Template Category to the Solution Team Layer

Click the “Save To” drop-down button at the bottom of the options page and select “Solution Team Options”.

Template Dialog

CodeRush saves the newly added template category to the solution team options layer and closes the Templates options page.

When you open your solution, CodeRush loads the newly created template. You can expand this template in the code editor.

CodeRush stores settings of the solution team options layer inside the (.cr\team) solution directory. The (.cr\personal) solution directory contains your preferences for the current solution.

To share the settings with you team:

  1. Correct .gitignore or .hgignore files if you use git or mercurial as the source control to exclude the “.cr\personal” folder from it and to include the “.cr\team” folder.

  2. Commit files inside the “.cr\team” folder to the source control. These files will be available to all users in your team.

For more information on Options Layers, refer to the Options Layers topic.