Reputation: 77
What would be a sequence of operations to rename an MVC3 project directory in Visual Studio 2010? I can rename a project without any problems. However, if I try to detach it from solution and rename the directory containing it, attaching it back fails.
Upvotes: 1
Views: 2646
Reputation: 4129
Method to preserve references:
Assumtions:
Original:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccess", "src\DataAccess\DataAccess.csproj", "{030E25DF-77F2-012E-94EC-4E4D7D1C62E8}"
After renaming project, before editing .sln:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccess2", "src\DataAccess\DataAccess2.csproj", "{030E25DF-77F2-012E-94EC-4E4D7D1C62E8}"
After editing .sln:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccess2", "src\DataAccess2\DataAccess2.csproj", "{030E25DF-77F2-012E-94EC-4E4D7D1C62E8}"
Upvotes: 5
Reputation: 619
I usually do this:
Downside is you will lose any project references and you will have to redo them.
Upvotes: 0