How to rename project files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrcw
    New Member
    • Nov 2008
    • 82

    #1

    How to rename project files

    i created a new project. After a couple of weeks I noticed that I had misspelt it. I renamed the namespace and the project directory to the correct name,but in the project directory along with the c sharp file is another sub-directory with the original misspelt name. Is there a way to rename that sub-directory? I know it is not necessary but it just looks good and keeps everything nice.

    Thnx
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    Yea, this is one of my frustrations with Visual Studio... this is rather annoying to do.

    Go ahead and rename your folders via windows explorer, but make sure you update the appropriate paths in the solution file (via notepad) and potentially any project files that reference a renamed folder.

    Comment

    • Willjoe
      Banned
      New Member
      • Jul 2022
      • 12

      #3
      Set the file path to the new folder location. Right-click > Reload project. Change the display name of the project. Right-click > Rename.

      Regards,
      Will

      Comment

      • pritikumari
        Banned
        New Member
        • Jan 2023
        • 23

        #4
        In the dialog that opens, choose the rename strategy.

        If the project name is the same as the name of its root folder, select Rename directory.

        PyCharm will perform the Rename refactoring so that all the references to the directory throughout the code remain valid.

        If the project name is different from the name of its root folder, select Rename project.

        Alternatively, select File | Rename Project from the main menu and type the new name of the project in the dialog that opens.

        Also select this option if your application is deployed to a remote server and the project root folder is mapped to the server root.

        Comment

        Working...