Visual Studio解决方案中的文件夹或项目? [英] Folders or Projects in a Visual Studio Solution?

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

问题描述

推荐答案

在解决方案分解为逻辑层时,最好使用单独的项目,

默认情况下,始终在同一个项目中创建新文件夹

By default, always just create new folder within the same project


  • 您将获得单个程序集没有额外的ILMerge体操)

  • 更容易模糊(因为您的公共类型和方法较少,理想情况下根本没有)

将源代码分离成多个项目只有在...时才有意义

Separating your source code into multiple projects makes only sense if you...


  • 源代码是项目的一部分,但默认情况下不可部署(单元测试,额外的插件等)。

  • 更多开发人员参与,您希望将他们的工作视为可消耗的黑盒子。 (不太推荐)

  • 如果您可以将项目清晰地分离为隔离的图层/模块,并确定它们不能交叉消费内部成员。 (也不推荐,因为你需要决定哪个方面是最重要的)

  • Have some portions of the source code that are part of the project but not deployable by default or at all (unit tests, extra plugins etc.)
  • More developers involved and you want to treat their work as consumable black box. (not very recommended)
  • If you can clearly separate your project into isolated layers/modules and you want to make sure that they can't cross-consume internal members. (also not recommended because you will need to decide which aspect is the most important)

如果你认为你的源代码的一些部分可以重用,仍然不会将其创建为一个新项目。只需等待,直到你真的想在另一个解决方案中重用它,并根据需要将其从原始项目中分离出来。编程不是一个lego,重用通常是非常困难的,往往不会按计划发生。

If you think that some portions of your source code could be reusable, still don't create it as a new project. Just wait until you will really want to reuse it in another solution and isolate it out of original project as needed. Programming is not a lego, reusing is usually very difficult and often won't happen as planned.

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

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