visual-studio 如何将现有文件夹添加到 Visual Studio 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3057461/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:07:10  来源:igfitidea点击:

How to add an existing folder to a Visual Studio project?

visual-studiodirectoryprojects-and-solutions

提问by Earlz

I have a web application project made in Visual Studio 2008.

我有一个在 Visual Studio 2008 中制作的 Web 应用程序项目。

Well, I added a jqueryfolder and added it to source control and other such things. I forgot to add it to the visual studio project though. How do I add the existing folder now? I've tried just creating a new folder and naming it jquerybut it gave me a cryptic error "the directory is already on the disk ... if you want to see this directory then check the Show All Files option in the project file" Yet I looked and saw no such option.

好吧,我添加了一个jquery文件夹并将其添加到源代码管理和其他类似的东西。不过,我忘了将它添加到 Visual Studio 项目中。我现在如何添加现有文件夹?我试过只创建一个新文件夹并命名它,jquery但它给了我一个神秘的错误“目录已经在磁盘上......如果你想看到这个目录,然后检查项目文件中的显示所有文件选项”然而我看了看,没有看到这样的选择。

Is the only way around this to rename jqueryto jquery2and then create a new folder via visual studio named jqueryand copy all my files into it?

围绕这个问题的唯一办法重新命名jquery,以jquery2然后创建一个名为通过Visual Studio的一个新文件夹jquery和我所有的文件复制到它?

回答by heavyd

With your project open in Visual Studio, click on your project. Then go to the "Project" menu and select "Show All Files". You should now see any directories or file that are in the directory of the project but not included in the project.

在 Visual Studio 中打开您的项目后,单击您的项目。然后转到“项目”菜单并选择“显示所有文件”。您现在应该看到项目目录中但未包含在项目中的任何目录或文件。

Then, right-click on the folder you want to add, and select "Include in Project" from the context menu.

然后,右键单击要添加的文件夹,并从上下文菜单中选择“包含在项目中”。