问题描述
在Visual Studio中(2010年),才有可能在项目级别创建一个解决方案文件夹?Visual Studio中搜索
一个虚拟的项目文件夹?
In Visual Studio (2010) is it possible to create a "Solution Folder" at the project level?
A "virtual" project folder within Visual Studio?
问题:
我们有我们的解决方案的一个项目,其中包含我们所有的文化资源文件。我们采用每个经营宗旨单个资源文件,即我们代表每个文化的多个资源文件。
We have a project in our solution which contains all our culture resource files. We employ a single resource file per business purpose, i.e. we have more than one resource file representing each culture.
对于不同的文化资源文件必须存放在同一个位置(路径)这将导致或包含许多资源文件在根级别项目。这是罚款的时间感,但我们添加了不同的文化支持的资源文件的数量将增长到无法管理的数
As resource files for different cultures have to be stored at the same location (path) this results in or project containing many resource files at the root level. This is fine for the time-being but as we add support for different cultures the number of resource files will grow to an unmanageable number
所以,为了更好地组织我们的项目我们希望在项目层面,我们可以为每个文化的一个文件夹来创建一个虚拟的文件夹。这可能吗?
So in order to better organize our project we'd like to create a "virtual" folder at the project level where we can create one folder per culture. Is this possible?
有什么想法?
推荐答案
我很肯定你不能。这一直是一个奇怪的语气对我的VS,在解决方案中的文件夹是虚拟的,但在项目文件夹都没有。我不喜欢的虚拟文件夹反正,因为你可以运行到奇怪的细微差别,因为文件的物理运动不同步与虚拟文件夹结构入住。令我头痛。我一直希望能有在解决方案级别将整个项目共享的东西物理文件夹。
I'm pretty sure you can't. This has always been a odd nuance to me of VS, that the folders in solutions are virtual, yet the Project folders are not. I don't like the virtual folders anyways, because you can run into strange nuances because your physical moving of files doesn't stay in sync with the structure in the virtual folders. Has caused me headaches. I've always wished there were physical folders at the solution level for putting things shared across projects.
步骤1)如果他们只是需要在同一个物理文件夹,然后开始我将它们移动到该项目的资源子文件夹。我一直很少在我的项目的根。即使源代码进入一个SRC文件夹中。只留下东西像根* .config文件。
Step 1) If they just need to be all in the same physical folder, then to start with I would move them into a Resources subfolder of the project. I keep very little in the root of my projects. Even source code goes into a "src" folder. Leaving only things like *.config files in the root.
步骤2)创建,你从项目拖动文件到它需要在解决方案层面的几个虚拟文件夹适当的虚拟化解决方案的文件夹。该文件将仍然真实存在,在项目中的资源文件夹中显示,但对于文件更方便用户浏览,他们将在刚刚引用原文件中的虚拟文件夹存在。
Step 2) Create several virtual folders as needed at the solution level where you drag the files from the project into it's appropriate virtual solution folder. The file will still physically exist and show in the "Resources" folders at the project, but for more user friendly browsing of the files, they will exist in the virtual folders which just references the original file.
我意识到这是不太理想,但认为我会指出,没有什么是使用同时具有文件解决方案级别的文件夹阻止你在项目中实际存在
I realize this is less than ideal, but thought I'd point out that nothing is stopping you from using the solution level folders while having the files exist physically in the project.
不过,正如我所说,如果你添加新资源文件到你的项目,你永远需要采取将其拖动到的归类这些额外的步骤虚拟化解决方案的文件夹。这是那些东西,很可能是不同步的,因为你会忘记这些,如果你去了几个星期没有碰这个项目之一。
But as I mentioned, if you add new resources files to your project, you will always need to take that extra step of "categorizing" them by dragging them into a virtual solution folder. This is one of those things that is likely to get out of sync because you will forget about these if you go a few weeks without touching this project.
有一个更好的解决办法可能是使用某种自定义生成步骤的,可能与恶性或MSBuild的,这需要存储在单独phyiscally资源文件夹,并将它们复制资源到一个单一的资源文件夹编译之前。这样,你在每个子文件夹创建资源,并自动生成步骤把它们拷贝到单个目标文件夹。
A better solution might be to use some sort of custom build step, maybe with nant or msbuild, that takes Resources stored in phyiscally seperate resource folders and copies them into a single resource folder before compilation. This way you create resources in each subfolder, and the build step automatically copies them into the single destination folder.
这篇关于在项目级别的Visual Studio解决方案文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!