JetBrains Rider 2017.2 Help

Code Inspection: Namespace does not correspond to file location

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 code inspection: Namespace does not correspond to file location

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

Namespaces are made deeper with the introduction of folders. A folder called Psi will necessitate all items it contains to appear in the JetBrains.ReSharper.SolutionAnalysisTests.Psi namespace. This can, however, be circumvented in cases where you do not need the folder to append extra namespace elements. To avoid this, select the folder and open its properties. Then, set Namespace Provider to False.

JetBrains Rider code inspection: Namespace does not correspond to file location

The folder will no longer influence the namespace of elements it contains, and JetBrains Rider will not issue suggestions accordingly.

Last modified: 23 November 2017

See Also