Search code examples
resharperresharper-4.5using-directives

How to prevent ReSharper from shortening namespaces when adding using directives?


When I use ReSharper to add a using directive (using Alt+Enter) it removes "unnecessary" parts of the namespace. I prefer using the full namespace which is also the behavior of Visual Studio.

Example:

namespace MyCompany.MyTool.Data
{
    // This is what ReSharper gives me:
    using Core;

    // This is what I want:
    using MyCompany.MyTool.Core;

    // ...
}

Which setting do I have to change in ReSharper 4.5 so it uses the full namespace?


Solution

  • I don't have ReSharper 4.5 installed at the moment, but in 5.0 there's an option at the Namespace Imports pane called Prefer fully qualified using name at nested scope. It might be the one you're looking for.