ReSharper 2018.1 Help

Fix inconsistent namespace naming

You have probably seen that, when the namespace declaration does not match the file location and/or project settings, ReSharper warns you about it and allows you to correct it:

ReSharper quick-fix to synchronize namespace to the file location

However, if you have several files with incorrect namespaces, going through them one by one can be a pain. Luckily, you can simply press Ctrl+Shift+R on a node in the Solution Explorer and select Adjust Namespaces:

ReSharper helps fix namespaces in a project

This will pop up a dialog letting you select all files where namespaces need to be adjusted:

Synchronizing namespaces with project structure

After you pick the namespaces to fix, they will be adjusted to their expected values (dependent upon project settings and file location).

Last modified: 20 August 2018

See Also