如何在Visual Studio中将现有目录树添加到项目中? [英] How do I add an existing directory tree to a project in Visual Studio?

查看:242
本文介绍了如何在Visual Studio中将现有目录树添加到项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题确实很简单.我没有在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. How do I include all the folders and files in a project, keeping the structure?

如果我在名为Services的文件夹上添加现有文件"并导航到目录结构中的文件.. Services> AccountManagement> CreateAccount.cs,则它在Visual Studio中的显示方式如下:Services> CreateAccount.cs.我不要这个.

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. I do not want this.

我已经制定出了完整的目录结构,因为我在模仿我们的客户开发人员使用相同的组织结构.如何在Visual Studio中将所有文件夹和文件添加到项目中?还是我必须做大多数Microsoft用户要做的事情并使用它"并通过Visual Studio重新创建每个文件夹?

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? 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?

推荐答案

您需要将目录结构放在项目目录中.然后单击解决方案资源管理器"工具箱顶部的显示所有文件"图标.之后,将显示添加的目录.然后,您需要选择此目录,右键单击,然后选择包含在项目中".

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."

这篇关于如何在Visual Studio中将现有目录树添加到项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆