Back to Devexpress

Move File to Folder

coderushforroslyn-403440-refactoring-assistance-move-file-to-folder.md

latest1.4 KB
Original Source

Move File to Folder

  • Dec 10, 2021

Purpose

Moves a file to a folder that corresponds to the current namespace.

Availability

Available when the caret is in a namespace declaration or file-scoped namespace declaration. The file must be located in a folder whose name is different from the namespace name.

Usage

  1. Place the caret in a namespace declaration or file-scoped namespace declaration (for C# 10):

  2. Press Ctrl + . or Ctrl + ~ to invoke the Code Actions menu.

  3. Select Move File to Folder: {Folder Name} from the menu.

After execution, this refactoring moves a file to a folder that matches the selected namespace. If the target folder does not exist in the solution, this refactoring creates this folder.

The following screencast shows the “Move Type to Folder” refactoring in action for C#:

See Also

Move Type to File

Move Type to Namespace

Move All Types to Files

Rename File to Match Type

Rename Type to Match File