ReSharper can replace fully qualified names with short names in C# and VB.NET code where possible by importing namespaces.
- Choose ReSharper | Options in the main menu.
- Open Code Editing | C# | Namespace Imports (for C# settings) or Code Editing | Visual Basic .NET | Namespace Imports (for VB.NET settings).
- 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.
- Open Code Editing | Code Cleanup options page.
- 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.
- 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.
- 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.
- Click Run to perform Code Cleanup. ReSharper will shorten qualified references in the current file of in the selected solution node.