I have a VS2013 solution called ShoppingService.sln with 7 projects under TFS source control.
Now I want to make a copy of the solution, rename it to 'BasketService.sln' and have it under source control again.
I don't want to make branches of the original solution, since both solutions should co-exist separate from each other.
What's the quickest or best way to do this?
Ok, here's what I ended up doing:
- Copy entire solution folder to new location.
- Remove any source control files. They begin with *.vs.
- Remove any read-only attributes on folders and files.
- Open solution from new folder and rename solution and each project.
- Open properties for each project and edit assembly name and default namespace.
- Close solution.
- Rename folders on disk.
- Edit solution file in a texteditor. Replace all references with new folder names, and remove team foundation section in .sln.
- Open solution again in VS and fix any leftover issues. I use Resharper to fix new namespaces.
- Search through all files for your old solution/folder name and update with new name
- Consider deleting the obj and bin folders to force Visual Studio to regenerate all of those files during a build
- Add solution to source control again.
And you're done.
Step 8a. Open all Project files (e.g. .CSPROJ, .projitems) in a text editor and edit folder pathnames to point to the new solution's folders.
Quickest
File --> save solution As. 'BasketService.sln'
Right Click Solution --> Add to source control.
Right click Solution --> Check In