Reputation: 1200
I’m working on a c# project, lately we decided to restructure the directories structure of the source code. I’m doing the restructure and wanted to ask you some questions about what is the best way to conduct the change. The restructure is basically changing the current directories of all the projects to a more structured and logical order.
The current structure is (this is a scheme):
Main Dir:
The Target scheme is: TFS Project: Main - Source - Dir - Solution file. - Project - Project - Project - Project
- Dir
- Dir
- Project
- Project
- Project
- Dir
- Solution file.
- Dir
- Project
- Project
The relative location between the projects is changed and also the relative locations in the solutions.
The question is how to make change in the best manner: - How to Fix all the references of each project? - How to fix all the solutions? - Is there any tool available for that?
Upvotes: 4
Views: 7826
Reputation: 21241
I am not aware of any tools that exist to automatically do this, but I do know of two options that you have, option 1 is to use VS to do the refactor (longer) or option 2 is to use something like powershell (or your favorite scripting language) to update the sln and csproj references.
If you are using option 1:
If using option 2:
Unfortunately it will be pretty manual, and pretty error prone. I recommend option #1, and have just gotten done doing it on a project with 100+ csproj and 30 sln files. There were about 4000 source files, which I moved by hand and then used find replace in vs studio (with the project unloaded) to update.
Good luck.
Upvotes: 1
Reputation: 596
If using option 2:
Move your non csproj/sln files to their target locations, make sure you understand the relative changes in your paths.
A couple of additions:
Upvotes: 3