简体   繁体   English

解决方案中的大多数项目

[英]Most number of projects within a solution

for VS 2005 is there a max number of projects that will cause performance issues. 对于VS 2005,最大数量的项目会导致性能问题。 We have now up to 25 projects and growing. 我们现在有多达25个项目并且还在增长。 Should we making these binary referenced or are we breaking out our application logic into too many different projects. 我们应该引用这些二进制文件,还是将我们的应用程序逻辑分解为太多不同的项目。 Seems to start to be a big performance issue lately. 似乎最近开始成为一个重大的性能问题。

Having too many DLL files can cost you at run-time so I would recommend that you try to minimize the amount of projects. 有太多的DLL文件可能会在运行时花费你,所以我建议你尽量减少项目的数量。 Creating several solutions is also an option but try to make the solutions independent of each other so that you don't have to debug and implement new features across several solutions - that can be cumbersome. 创建多个解决方案也是一种选择,但尝试使解决方案彼此独立,这样您就不必在多个解决方案中调试和实现新功能 - 这可能很麻烦。

Take a look at this article: Project anti-pattern: Many projects in a Visual Studio Solution File . 看一下这篇文章: Project anti-pattern:Visual Studio Solution File中的许多项目

Is there a chain of dependency through all 25 projects? 所有25个项目都有依赖链吗? If some projects aren't dependent on others, put them in their own solution. 如果某些项目不依赖于其他项目,请将它们放在自己的解决方案中。

Don't compile the whole solution if you don't have to and one usually doesn't. 如果您不需要,则不要编译整个解决方案,而通常不会编译整个解决方案。 Usually you can right click on the project you just modified and compile just that. 通常,您可以右键单击刚修改的项目并进行编译。 VS will figure out which dependent projects need to be re-compiled. VS将确定需要重新编译哪些依赖项目。

Use "start without debugging" unless you are planning to hit a break point. 除非您打算达到一个断点,否则请使用“start without debugging”。

Are some DLLs stable and haven't changed in long time? 一些DLL是否稳定并且长时间没有变化? They don't have to be in your solution either. 他们也不必在你的解决方案中。

Don't search entire solution unless you really have to. 除非你真的需要,否则不要搜索整个解决方案。

The real limitation is the human mind. 真正的限制是人的头脑。 How many files in one project can one deal with? 一个项目中可以处理多少个文件? Also, unless you are using ndepends to trace dependencies, putting to many classes in one project can lead to too many classes depending on other classes, making changes harder and riskier. 此外,除非您使用ndepends来跟踪依赖项,否则在一个项目中放置许多类可能会导致太多类,具体取决于其他类,从而使更改变得更难和更具风险。

Normally we try to keep the amount of projects within a solution under 10. After 10, you start to have slow compile time and slow "project reload" time. 通常我们会尝试将解决方案中的项目数量保持在10以下.10之后,您开始编译时间慢并且“项目重新加载”时间变慢。

But the main issue here is why do you have 26 projects? 但这里的主要问题是为什么你有26个项目? A simple web site could only have 1 project while keeping the Data Tier, Business Tier, Presentation Tier all inside the same project. 一个简单的网站只能有一个项目,同时保持数据层,业务层,表示层都在同一个项目中。

If you are splitting projects only for this 3 tier stuff, I suggest that you revise this. 如果你只为这3层东西拆分项目,我建议你修改它。 as an example, we have 3 projects for the 3 tier. 例如,我们为3层提供了3个项目。 The reason we have 3 tiers in separate assembly is that we are execting other software to use the data tier later in our project. 我们在单独组装中有3层的原因是我们正在考虑其他软件以便在我们的项目中使用数据层。 Keeping our business layer outside the main presentation project allows us to easily unit test our business tier while keeping useless dependencies outside the presentatier tier. 将我们的业务层保留在主要演示项目之外允许我们轻松地对我们的业务层进行单元测试,同时将无用的依赖关系保留在现有层之外。

So, overall, keep projects under 10 and review if you can merge some projects togheter. 因此,总的来说,将项目保持在10以下,并审查是否可以将某些项目合并到一起。 It will both save you time at compile time AND at build time. 它将在编译时和构建时节省您的时间。 It will also be more easy to manage those DLLs. 管理这些DLL也会更容易。

I would say it costs you at build time not runtime. 我会说它在构建时花费你而不是运行时。 And less is faster, but perhaps you don't always build all of them. 而且越少越快,但也许你并不总是建立所有这些。 If that is the case then you should reduce the amount. 如果是这种情况,那么你应该减少金额。 else split them up in different solutions. 否则将它们分成不同的解决方案。 Then only the build server will need to build all of them and a daily build has all night to build ;-) 然后只有构建服务器需要构建所有这些并且每日构建都需要整晚构建;-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM