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
Open your solution in Visual Studio.
Select the “CodeRush | Code Templates…” item in Visual Studio’s menu to open the templates options page.
Click the “New Category” toolbar button.
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.
Right-click the newly added category and select “New Template”
In the “New Template” dialog, enter the “t1” template name and click OK.
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”.
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:
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.
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.