How can you create a folder in a solution project inside an already existing physical folder with EnvDTE
?
project - folder - create this folder
How can you create a folder in a solution project inside an already existing physical folder with EnvDTE
?
project - folder - create this folder
This works for C++ project in VS2012. For other project types you might need to use physical folder, not sure. The code assumes you've got "First Level Folder" folder in your project already.
Project project = null; // you should get the project from the solution or as active project or somehow else
ProjectItem folderItem = project.ProjectItems.Item("First Level Folder");
folderItem.ProjectItems.AddFolder("Second Level Folder", Constants.vsProjectItemKindVirtualFolder);
Note that the code might not compile and run properly, it is just a snippet.