How do I “Add Existing Item” an entire directory structure in Visual Studio?

前端 未结 18 1310
眼角桃花
眼角桃花 2020-11-28 00:18

I have a free standing set of files not affiliated with any C# project at all that reside in a complicated nested directory structure.

I want to add them in that for

18条回答
  •  囚心锁ツ
    2020-11-28 00:51

    I just want to point out that two of the solutions offered previously,

    • Drag and drop from Windows Explorer
    • Show All Files and then include in project.

    do not do what the question asked for:

    Include in project while preserving the directory structure.

    At least not in my case (C++/CLI project Visual Studio 2013 on Windows 7).

    In Visual Studio, once you are back in the normal view (not Show All Files), the files you added are all listed at the top level of the project.

    Yes, on disk they still reside where they were, but in Solution Explorer they are loose.

    I did not find a way around it except recreating the directory structure in Solution Explorer and then doing Add Existing Items at the right location.

提交回复
热议问题