ReSharper Web Help

ReSharper can replace fully qualified names with short names in C# and VB.NET code where possible by importing namespaces.

To shorten qualified references
  1. Choose ReSharper | Options in the main menu.
  2. Open Code Editing | C# | Namespace Imports (for C# settings) or Code Editing | Visual Basic .NET | Namespace Imports (for VB.NET settings).
  3. You can choose to use fully qualified names always or to use short names with namespace imports. In the Reference Qualification section click Insert using directives when necessary or Use fully qualified names. Moreover, you can fine-tune replacing by selecting check boxes.
  4. Open Code Editing | Code Cleanup options page.
  5. Create a new profile as described in Creating Custom Profiles. In the Selected profile settings section for the new profile, select Shorten qualified references check box.
  6. Click Save to apply the modifications and let ReSharper choose the settings layer, or choose a particular settings layer in the Save To drop-down list. To learn more about saving ReSharper settings, see JetBrains .NET Tools Blog: Save or Save To in ReSharper Options.
  7. Choose ReSharper | Tools | Cleanup Code in the menu to open the Code Cleanup dialog box for the current file or for a solution node (see Running Code Cleanup for details), and then select the newly created profile in the Available Profiles area.
  8. Click Run to perform Code Cleanup. ReSharper will shorten qualified references in the current file of in the selected solution node.

See Also