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

查看:27
本文介绍了如何将现有目录树添加到 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天全站免登陆