Reputation: 107
I need help figuring out a way to create physical folders in Visual Studio 2022 so that they will appear in both file explorer and solution explorer. I have existing projects which sit inside solutions. I want to create two folders using Visual Studio, name them "dev" and "prod" and move existing projects to these folders.
I am using Visual Studio 2022, which does not have the option to add folders. I can create logical folders by right-clicking on the solution and selecting "New Solution Folder" but it doesn't appear inside file explorer.
Please let me know of any workaround to achieve the same. Many thanks in advance!!!
Upvotes: 3
Views: 7017
Reputation: 28376
Solution Folders are a virtual hierarchy node to allow you to organize the solution items (projects or other files), without any association to what's on disk. Some project types also offer similar functionality to organize the project contents separately from how they are saved to disk.
One way to work around this is to switch to Folder View. However, this will unload your solution and projects so you'll have to toggle back and forth.
To switch to folder view, press this button:
That will show you a list of the available solutions, with a Folder View in the list. Selecting Folder View will switch Solution Explorer to showing the layout of files as they exist on disk. You can then create the folders you want. To switch back, press the button again, and select your solution from the list.
Some IDE features may not work in Folder View if they depend on the project being loaded.
Upvotes: 2
Reputation: 400
Tools -> Options -> Environment -> Keybord
Search for Project.NewFolder
and set your desired keyboard shortcut.
Upvotes: 0