MS Visual Studio has Solution Explorer where I can see all project files, I can also create filters which are like folders for files to keep them in groups. The problem is - I want my files divided in groups both in Visual and physically on my disk. But I don't want to have to apply each change twice both in Visual and on my disk. Is there any way to show actual folders, in which I keep my files on disk, in Visual Solution Explorer (and no - "Show all files" doesn't do that, I've just checked)?
In Visual Studio, click File > Open > Folder. Navigate to the folder, and click Select Folder. This opens the folder in Solution Explorer and displays its contents, files and any subfolders.
With ReSharper installed Shift + Alt + L will find the current file in Solution Explorer in Visual Studio 2008+. when you track you don't need this shortcut.
To create a folder within the solution, right-click the solution name in the Solution Explorer pane and choose "Add", then "New Solution Folder" from the context-sensitive menu. To create a subfolder, start by right-clicking an existing solution folder and then choose the same menu options.
Select the project in Solution Explorer. 4. Click "Show All Files".
No - SE and the Filing System hold independent copies of the structure/hierachy information.
I usually disable the filters and put files where I want them, so that the two structures remain in sync by default (indeed, any other way seems like madness if you want to have any kind of organisation of source code - I always group files for components inot separate folders).
Then (with filters disabled)...
If you create the folders in Solution Explorer, and use the context menu from that folder to "Add new item..." or "Add existing item" then the disk structure will reflect the solution explorer (existing items are copied rather than referenced from where they currently reside to ensure this, which can result in old copies of files being left around your project if you add to the wrong SE folder). Otherwise it is usually only if you "add as link" that VS will put an item in a different folder in the SE than it appears on disk.
To tidy things up, the easiest approaches are (after making a backup copy just in case):
Once they're in sync, only use the SE to manage the files, and be careful to add items using the context menu from the correct folder. If you move things about on disk, you'll break the links.
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