什么是Visual Studio中的解决方案文件夹? [英] What is a solution folder in Visual Studio?

查看:313
本文介绍了什么是Visual Studio中的解决方案文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Visual Studio 2008解决方案,我想在解决方案中包括一个真实的文件夹,但不在项目级别,而是在解决方案级别.

I have a Visual Studio 2008 solution, and I would like to include a real folder in the solution, but not at the project level, instead at the solution level.

我注意到您可以右键单击解决方案并添加一个解决方案文件夹,但是它以白色文件夹的形式出现,我对确切的含义感到怀疑.

I noticed you can right click the solution and add a solution folder, but it comes up as some white folder, and I have my doubts as to exactly what it is supposed to be...

基本上在文件系统上,我有c:\ mySolution \ myFolder ...

Basically on the file system I have c:\mySolution\myFolder...

我希望将myFolder添加到解决方案中,以便项目也受源代码控制...

I want that myFolder is added to the solution, so that items are also under source control...

推荐答案

我也希望能够将物理文件夹添加到解决方案中,但是不幸的是,您不能在项目外部这样做.

I also would like to be able to add physical folders to a solution, but unfortunately you can't do so outside a project.

我发现最好的解决方案是添加一个与物理文件夹(在您的示例中为myFolder)同名的解决方案文件夹,然后将文件从该物理文件夹添加到解决方案文件夹中.

The best solution I have found is to add a solution folder with the same name as the physical folder (myFolder in your example), then add files from that physical folder to the solution folder.

但是,Visual Studio不会在解决方案文件夹和物理文件夹之间维护映射,这意味着:

However Visual Studio does not maintain a mapping between the solution folder and the physical folder which means that:

  • 随后使用Visual Studio在解决方案文件夹中创建的新文件不会自动放置在物理子文件夹中(我认为默认情况下它们是在解决方案根文件夹中创建的)

  • new files subsequently created in the solution folder using Visual Studio are not automatically placed in the physical subfolder (I think they are created in the solution root folder by default)

文件也不会在解决方案文件夹中自动显示.

files added to the physical folder are not automatically visible in the solution folder, even with "Show All Files".

要添加新文件,因此我总是在Visual Studio外部的物理文件夹中创建新文件,然后使用添加/现有项"将其添加到解决方案文件夹中.

To add new files, I therefore always create the new file in the physical folder outside Visual Studio, then add it to the solution folder using "Add/Existing Item"

这篇关于什么是Visual Studio中的解决方案文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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