JetBrains Rider 2023.3 Help

Build configurations

The development units of .NET programs are projects, which are then organized into solutions. Build management follows the same principle so that build preferences are stored in project configurations, which are then managed by solution configurations.

Project build configurations

A project configuration defines how the project should be build, for example, whether to optimize the code and/or include debug information. Different project types allow different sets of build properties.

You can have multiple build configurations for a project so that you can build the same code for different platforms and purposes.

When you create new projects, two project configurations are normally added from project templates: Debug, which is optimized for debugging, and Release, which produces binaries for deploying your code. If necessary, you can add custom build configurations for any project.

When you build a project (either as part of building the entire solution or a selected project only) Rider will use a build configuration that is specified for this project in the currently selected solution configuration.

Configure properties of project build configurations

  1. In the Solution window, right-click the desired project and choose Properties.

  2. In the Project properties dialog that opens, select a project build configuration.

  3. Edit build properties of the selected configuration as needed and click OK to apply your modifications:

    JetBrains Rider: Project Properties dialog
  4. Optionally, you can configure commands to execute before and/or after build in the Build Events of this dialog. The format of pre- and post-build commands and acceptable macros are the same as in Microsoft Visual Studio. For more information, refer to Microsoft Docs. How to: Specify build events.

Solution build configurations

A solution configuration defines which projects in the solution are build, and which project configurations are used for specific projects within the solution.

Similarly to projects, a newly created solution includes the Debug and Release configurations, which can be complemented by your custom configurations.

You can switch and manage build configurations of the current solution using the corresponding control in the right part of the toolbar:

Rider: Build configuration selector on the toolbar

Manage solution build configurations

  1. Choose Edit Solution Configurations in the build configurations selector on the toolbar.

  2. In the dialog that opens, expand the solution configuration selector and choose Edit.

    JetBrains Rider: Solution Properties dialog
  3. This will bring up another dialog where you can choose how to manage solution build configurations.

  4. Choose the desired action (Add, Remove, Edit, or Duplicate).

    If you are creating or editing a solution build configuration, you can specify a name and a platform for it.

    The important thing about managing solution build configuration is that by default, Rider will modify (i.e, add, remove, edit or duplicate) project build configurations that match the name and the platform of the modified solution configuration.

    If you do not want to modify project configurations, clear the corresponding checkbox in the dialog:

    JetBrains Rider: Adding solution build configuration
  5. Click OK to apply changes in each of the dialogs.

Set up project configurations for the current solution configuration

  1. Choose Edit Solution Configurations in the build configurations selector on the toolbar.

  2. In the dialog that opens, first choose a solution build configuration that you are going to use.

  3. Use the selector next to a project to specify which project build configuration should be used in the current solution build:

    JetBrains Rider: Adding project build configuration

    If necessary, click Edit to bring up another dialog where you can add new or duplicate existing project build configurations.

  4. If you want to exclude some projects from the solution build process, just clear checkboxes in the Build column next to the project.

    Note, that you can still build excluded projects — right-click the project in the Solution view and choose Build selected projects.

  5. Click OK to apply changes.

Last modified: 18 March 2024