Programming
visual-studio-2010 visual-studio visual-studio-2008
Updated Fri, 26 Aug 2022 08:35:19 GMT

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


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?




Solution

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





Comments (5)

  • +3 – thanks for the response! That worked!!! :) I just edited the line: Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CCP Utility", "CCP Utility\CCP Utility.csproj", "{FE1F9ED8-F161-485F-B9E6-357852321137}" — Mar 15, 2011 at 18:47  
  • +0 – @DenisIvin Thanks so much. Please Microsoft make this easier — Jul 11, 2012 at 21:42  
  • +7 – It should be noted that this will remove your project from source control if it's under there previously — Jun 20, 2013 at 08:01  
  • +1 – In addition, you need to update the .csproj file for all projects that refer to the project for which you changed folder name. .csproj files are also text files, so that is easily done. — Jan 07, 2014 at 15:43  
  • +0 – @dougajmcdonald and passersby, I handled this by moving the project to a new directory using the source control program first. — Aug 10, 2015 at 18:45