JetBrains Rider 2024.3 Help

Configure file and folder properties

File properties

Each file in the solution has a number of properties that define how to treat this file. To access these properties, press Alt+Enter when one or more files are selected in the Solution Explorer or right-click the selection and choose Properties.

JetBrains Rider: File Properties dialog

Properties in the General and Diagnostic sections are not editable, but you can copy them. Editable properties include:

Build Action

This property defines what to do with the file during the project build. It is assigned automatically when the file is created according to the file type, but you can change it if necessary.

Available values come from MSBuild, and you can find their descriptions in the Microsoft Docs.

Copy to output directory

This property define whether to copy the file to the Debug or Release folder during the project build. It is assigned automatically when the file is created according to the file type, but you can change it if necessary.

Available values come from MSBuild and you can find their descriptions in the Microsoft TechNet website.

Custom Tool

If you want to perform some task each time the file is updated, you can specify a custom tool that would take the file as an input and, for example, generate one or more other files. Some file types rely on custom tools. For example, .settings files use SettingsSingleFileGenerator, .resx files use ResXFileCodeGenerator, .dbml files use MSLinqToSQLGenerator.

Custom Tool Namespace

Use this property to specify a namespace for files generated by the custom tool. The specified value will be processed by the specified custom tool, and there is no guarantee that the custom tool will add this namespace. The property will be ignored if no custom tool is specified.

Folder properties

Project folders have a single editable property — Namespace provider — that helps JetBrains Rider synchronize namespace names with the project folder structure.

By default, JetBrains Rider assumes that the namespace each class appears in matches its location in the project. The 'root' namespace for the project is defined in the project properties:

JetBrains Rider: Root namespace in the project properties

As a result of the above, all code elements at the project level are expected to appear in the ShareX namespace, and a warning will be issued otherwise.

Namespaces are made deeper with the introduction of folders. In the example below, a folder called StartupManagers will necessitate all items it contains to appear in the ShareX.StartupManagers namespace. However, there are cases where you do not need the folder to append an extra namespace element. In such cases, you can select the folder and open its properties. Then, clear the Namespace Provider checkbox.

JetBrains Rider: 'Namespace provider' property of a project folder

A folder which is not a Namespace Provider will not influence the namespace of elements it contains, and JetBrains Rider will analyze and refactor the related code accordingly.

To access folder properties, press Alt+Enter when it selected in the Solution Explorer or right-click it and choose Properties.

Last modified: 22 April 2024