Avatar of naqsh
naqsh

asked on 

How to add a folder and subfolders to a Visual Studio Project

I have recently started using MS Visual C++ .NET for development.

My source files are contained in a complex folder structure with multiple level subfolders.

I have been looking for some way to add this complete folder structure to a Visual Studio project in one shot but haven't been able to find one so far.

What I am doing right now is the following
   
  - Project -> Add existing element
  - Browse to the base folder containing the files
  - Select All files in the folder and click add

However, since the source is spread over more than 100 subfolders, it would be extremely tedious for me to repeat the same for every subfolder.

Can anyone please help me here? Thanks in advance
.NET ProgrammingVisual C++.NET

Avatar of undefined
Last Comment
naqsh
Avatar of philipjonathan
philipjonathan
Flag of New Zealand image

1. In VS menu, choose Project -> Show All Files.
2. Go to Solution Explorer, and navigate to your project
3. You will see the files. Those that are grey-ed out are those that haven't been added to the project.
4. You can just select the folder (multiple select by holding CTRL button while clicking)
5. Right click and choose Include In Project.
Avatar of naqsh
naqsh

ASKER


Thanks for your reply philipjonathan but I can't see the option Show All Files under Project menu.

You can see that from the snapshot attached.
vs-menu.bmp
ASKER CERTIFIED SOLUTION
Avatar of philipjonathan
philipjonathan
Flag of New Zealand image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of naqsh
naqsh

ASKER

Thanks man. Great solution

Just to point out for anyone that reads this solution subsequently, DummyProj.vbproj should be placed in the same directory containing the top level folder for the folder structure to be added.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo