ReSharper replaces fully qualified names with short names in C# and VB.NET code where possible by importing namespaces.
To shorten qualified references
- Choose ReSharper | Options | Languages | C# | Namespace Imports (for C# settings) or ReSharper | Options | Languages | 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 tune replacing, select or clear check boxes.
- Choose Tools | Code Cleanup in ReSharper Options dialog box.
- 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 OK to save the new profile and close the ReSharper Options dialog box.
- Open the Code Cleanup dialog box from the text editor or Solution Explorer as described in
Running Code Cleanup.
- When the Code Cleanup dialog box opens, select the newly created profile in the Available Profiles area.
- Click Run to perform Code Cleanup. ReSharper will shorten qualified references.