I've made a lot of changes (a.k.a refactoring) to my (big) visual studio solution and it appears now that vs solution structure is very different in visual studio from what it is on the disk and TFS.
Is there a way to make file system (and TFS) have the same folder names and file names as in visual studio solution with some tool or script/program/helper add-in?
This is the list of main issues: - when I rename project visual studio does not rename folder where this project is located - if I move project, file to different vs folder, it just happens in visual studio, but not on the disk
from the menu on the top-right corner of the Visual Studio Code IDE. You can also use a keyboard shortcut Control+Shift+P in Windows and Command+Shift+P in MacOS to open the command palette and choose Now: Sync Current File from the list.
It updates namespaces in your code to match folder structure. For example, if you have a file Class1. cs in folder Models it changes the code namespace in Class1. cs to Project.
Adding folders#The File > Add Folder to Workspace command brings up an Open Folder dialog to select the new folder. Once a root folder is added, the Explorer will show the new folder as a root in the File Explorer. You can right-click on any of the root folders and use the context menu to add or remove folders.
You can switch between logical or physical folders in the solution by clicking the "Show all files" icon (2nd top left icon in the solution pane). When not activated, you are viewing logical folders in the solution, drag and drop simply re arrange files virtually. When activated, you are viewing physical folders, drag and drop moves files on disk, using the source controller.
No there are no tools that can help you do this automatically.
There is a two step approach to solve it, made easier by installing two add-ons. I prefer to use the Team Foundation Power Tools and the Source Control Explorer Extensions.
From the Source Control Window inside Visual Studio:
Alternatively, do the changes on file system with the Team Foundation Power Tools explorer extensions installed:
Then re-load the solution in Visual Studio and:
Rebuild your solution to verify all changes went as expected
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With