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

查看:24
本文介绍了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:mySolutionmyFolder...

Basically on the file system I have c:mySolutionmyFolder...

我希望将 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天全站免登陆