Visual Studio 2019: use folder structure as filter

LD 1 Reputation point
2020-10-26T15:00:33.277+00:00

Hello,
I need to import a huge amout of source files into my project. All the files are grouped in folders and subfolders.
How can I achieve the same groups in my project by using filters? Creating all the filters by hand is not an option.
Thanks in advance.
LD

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,685 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 27,801 Reputation points Microsoft Vendor
    2020-10-27T04:20:15.807+00:00

    Hello @LD ,

    Thank you for taking time to post this issue in Microsoft Q&A forum.

    If you want to import the files into the project and keep the folder structure, this method may work, please refer to following steps:

    1). Prepare the folders and subfolders.

    2). Put the folders into the bin (folder) > Debug or Release folder in your project folder.

    3). Open your project in Visual Studio > click the Show All Files button > expand the bin, Debug > select and right-click the parent folder > choose Include in Project option.

    35361-1.png

    35275-2.png

    4). Select and drag the parent folder to your project > click OK, if you see a pop-up window mentioned One or more files will be moved to XXXX… > the parent folder and the subfolders will be moved and included in your project.

    35346-3.png

    5). Right-click the bin > choose Exclude From Project > after that the bin folder will be exclude from your project > then click the Show All Files button again.

    35222-4.png

    I hope this helps.

    Sincerely,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    1 person found this answer helpful.
    0 comments No comments