I used the Create Project From Existing Code Wizard for Visual Studio 2008, but apparently projects created this way do not allow you to create virtual solution folders, and instead only allow you to create actual system folders. I would like to have the standard project setup of Header Files, Resource Files, and Sources Files, but I seem to be unable to create the virtual files required. Is there any way to change the project so that it allows virtual folders to be created?
Essentially all the source files within the project are stored in the same disk directory, but the filters virtualize the files into a hierarchy.
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.
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.
Adding FilesRight click the project or contained folder and choose Add | Existing Item... . Use Show All Files . Click on files or folders you would like to add to the project and choose Include In Project . Drag and drop files and folders from Windows Explorer.
At least for a C++ project created this way (not sure about other languages), the "Show All Files" button/option in the Solution Explorer is enabled which gives the behavior you're seeing.
Disable that option by clicking the icon and you'll get the behavior you're looking for.
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