Sync Visual Studio folder / file structure with file system structure / file names

I made a lot of changes (aka refactoring) to my (large) visual studio solution, and now it seems that the structure of the vs solution is very different in the visual studio from the fact that it is located on disk and TFS.

Is there a way to force the file system (and TFS) to have the same folder names and file names as in visual studio using some tool or script / program / helper add-in?

This is a list of basic questions: - when I rename a project, visual studio does not rename the folder where this project is located - if I move the project, the file to another vs folder, it just happens in visual studio, but not on disk

+6
source share
2 answers

There are no tools that could help you do this automatically.

There are two approaches to solving it, which are simplified by installing two add-ons. I prefer to use Team Foundation Power Tools and Source Explorer Explorer Extensions .

In the source control window inside Visual Studio:

  • Close an open solution in Visual Studio
  • open source control window in TFS
  • Move the folders around to fit the structure you prefer, with the indicated add-ons you should be able to drag and rename them more easily.

Alternatively, make changes to the file system using the Team Foundation Power Tools explorer extensions:

  • Close the solution in Visual Studio
  • navigate to the workspace folder using Windows Explorer
  • use the TFS context menu in folders to register / rename / move items and folders

Then reload the solution in Visual Studio and:

  • Open the solution and make sure that many projects are not loading.
  • Highlight a project that could not be found.
  • In the project properties window (ctrl-w, p) find the file path element and click the small button [...] to go to the new location of the project file for each project.
  • Rightclick projects that you have updated this way in Solution Explorer and reload them.

Restore your decision to verify that all changes went as expected.

  • Completion of changes
+2
source

You can switch between logical or physical folders in the solution by clicking the "Show all files" icon (icon of the 2nd upper left upper corner in the solution panel). When you are not activated, you look at the logical folders in the solution, drag and drop and simply organize the files in practice. When activated, you browse through physical folders, drag and drop move files to disk using the original controller.

+8
source

Source: https://habr.com/ru/post/907532/


All Articles