Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
776 views
in Technique[技术] by (71.8m points)

visual-studio - 如何在Visual Studio中将现有目录树添加到项目?(How do I add an existing directory tree to a project in Visual Studio?)

The issue is simple really.

(问题很简单。)

Instead of creating folders in Visual Studio, I create a directory structure for my project on the file system.

(我没有在Visual Studio中创建文件夹,而是在文件系统上为我的项目创建目录结构。)

How do I include all the folders and files in a project, keeping the structure?

(如何在项目中包含所有文件夹和文件,保留结构?)

If I "Add Existing File" on a folder named Services and navigate to a file in the directory structure .. Services > AccountManagement > CreateAccount.cs, it appears in Visual Studio like so: Services > CreateAccount.cs.

(如果我在名为Services的文件夹上“添加现有文件”并导航到目录结构中的文件..服务>帐户管理> CreateAccount.cs,它将显示在Visual Studio中,如下所示:Services> CreateAccount.cs。)

I do not want this.

(我不想要这个。)

I have an entire directory structure worked out already, as I am mimicking our client developers using the same structure for organization.

(我已经完成了整个目录结构,因为我模仿我们的客户端开发人员使用相同的组织结构。)

How do I add all the folders and files to the project in Visual Studio?

(如何在Visual Studio中将所有文件夹和文件添加到项目中?)

Or do I have to do what most Microsoft users do and "put up with it" and recreate each and every folder through Visual Studio?

(或者我必须做大多数Microsoft用户所做的事情并“忍受它”并通过Visual Studio重新创建每个文件夹?)

  ask by Brian Leahy translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to put your directory structure in your project directory.

(您需要将目录结构放在项目目录中。)

And then click "Show All Files" icon in the top of Solution Explorer toolbox.

(然后单击解决方案资源管理器工具箱顶部的“显示所有文件”图标。)

After that, the added directory will be shown up.

(之后,添加的目录将显示出来。)

You will then need to select this directory, right click, and choose "Include in Project."

(然后,您需要选择此目录,右键单击,然后选择“包含在项目中”。)

在此输入图像描述

在此输入图像描述


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...