Visual Studio - How to change a project's folder name and solution name without breaking the solution

Visual Studio-2010Visual StudioVisual Studio-2008

Visual Studio-2010 Problem Overview


I am creating a project based off an old project because it has a lot of the functionality that I am required to use.

I want to rename all the directories and solution names to have the name of the new project. Under Documents\Visual Studio 2008\Projects I was able to change the initial directory and solution file names, but not the name of the subdirectory which houses the bin, obj, and properties folders. When I change the name of that subdirectory, none of the files will open when I open up the solution.

How can I change the project's folder name inside Visual Studio 2008 so that it will load all the files as part of the solution and still work?

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

You could open the SLN file in any text editor (Notepad, etc.) and simply change the project path there.

Solution 2 - Visual Studio-2010

This is what I did:

  1. Change project and solution name in Visual Studio
  2. Close the project and open the folder containing the project (The Visual studio solution name is already changed).
  3. Change the old project folder names to the new project name
  4. Open the .sln file and the change the project folder names manually from old to new folder names.
  5. Save the .sln file in the text editor
  6. Open the project again with Visual Studio and the solution is ready to modify

Solution 3 - Visual Studio-2010

I found that these instructions were not enough. I also had to search through the code files for models, controllers, and views as well as the AppStart files to change the namespace.

Since I was copying my project not just renaming it, I also had to go into the applicationhost.config for IIS express and recreate the bindings using different port numbers and change the physical directory as well.

Solution 4 - Visual Studio-2010

go to my start-documents-iisExpress-config and then right click on applicationhost and select open with visual studio 2013 for web you will get into applicationhost.config window in the visual studio and now in the region chsnge the physical path to the path where your project is placed

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBrian McCarthyView Question on Stackoverflow
Solution 1 - Visual Studio-2010Denis IvinView Answer on Stackoverflow
Solution 2 - Visual Studio-2010TariqView Answer on Stackoverflow
Solution 3 - Visual Studio-2010user1161391View Answer on Stackoverflow
Solution 4 - Visual Studio-2010Lijin DurairajView Answer on Stackoverflow