12

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?

Albic
  • 3,559
  • 4
  • 22
  • 25

1 Answers1

10

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.

Igal Tabachnik
  • 31,174
  • 15
  • 92
  • 157
  • This option seems not to be present in 4.5. – Albic Dec 27 '09 at 12:08
  • 1
    And the option is still there in 10.0. Thanks! – Thomas Levesque Feb 01 '16 at 13:00
  • I've got Resharper 2022.2 and had the same questions. Looks like this option has been moved to a different place. On the left choose Code Editing | C# | Syntax Style and on the right pane choose "Reference qualification and 'using' directives" and check "Prefer fully qualified using name at nested scope". You may also check "Add 'using' directive to the deepest scope" if you typically put your using statements inside namespace. – Gennadiy Dec 06 '22 at 20:13