Reputation: 23177
I have a main project directory with the following contents:
SubDirectory (Directory)
Project.sln (Solution File)
When I try manually changing SubDirectory's name in my Windows explorer, I get errors when I open the solution file. How can I rename this directory without affecting my solution?
Thanks!
Upvotes: 1
Views: 559
Reputation: 6903
Once you've done all that, quit your text editor and try opening up your .sln file again.
HTH
Upvotes: 0
Reputation: 27486
There are probably paths in project/solution related files that contain the old directory name. You'll either have to update those manually or find a way to rename the project from within Visual Studio.
This might help you rename the project: http://msdn.microsoft.com/en-us/library/3e92t91t%28v=VS.90%29.aspx
Upvotes: 0
Reputation: 18420
Change the name in SolutionExplorer.. it will work fine..
However it doesn't gurantee problem with Source Control or TFS you will need to resolve them manually
Upvotes: 3
Reputation: 185583
Your solution has the paths to your project files embedded in it, which includes the folder name. If you want to rename the folder, you have three options:
Upvotes: 2
Reputation: 26426
Open up the .sln file in notepad. You'll see a line like this:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "myproject", "myproject\myproject.csproj", "{DF81752F-37EE-4F4E-BC22-B09C8D05ED78}"
EndProject
If you want to rename the folder from myproject
to newproject
, you can change myproject\myproject.csproj
to newproject\myproject.csproj
(or whatever).
Upvotes: 3
Reputation: 7439
When I have done it, I manually change it, then open the solution. You will get an error about not being able to find the project file, just choose to locate it, and it will re-map it. If you are using VSS, make sure everything is checked in first.
Upvotes: 1
Reputation: 33870
Rename it in Visual studio, or edit the .csproj/.sln file with a text editor and fix the refrences.
Upvotes: 3
Reputation: 18832
Open the solution file in a text editor and rename all references to the old folder.
Upvotes: 3