Renaming the containing project folder in VS.net under TFS

前端 未结 6 1963
猫巷女王i
猫巷女王i 2020-12-04 07:02

I have a vs.net project, and after some refactoring, have modified the name of the project. How can I easily rename the underlying windows folder name to match this new pro

6条回答
  •  我在风中等你
    2020-12-04 07:27

    For Visual Studio 2019 and ASP.NET Core 2.2 I had to modify Scott Munro's answer slightly. Here's what worked for me:

    Before you start: Check in all changes and make a backup of your solution.

    1. Rename the project using the Solution Explorer (i.e. right click the project and click rename).
    2. Rename the project folder in Source Control Explorer.
    3. Open your solution's .sln file in a text editor, and fix the file path. (Replace any references to "OldProjectName" with "NewProjectName").
    4. Reload your solution in Visual Studio.
    5. Find and replace all the old namespaces with the new project name.
    6. Done. Check in changes.

    I had to do step 1 first in order to get the project to load after fixing the file path in step 3.

提交回复
热议问题