解决方案中的大多数项目

时间:2023-01-16 16:57:00

for VS 2005 is there a max number of projects that will cause performance issues. We have now up to 25 projects and growing. 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.

对于VS 2005,最大数量的项目会导致性能问题。我们现在有多达25个项目并且还在增长。我们是否应该引用这些二进制文件,或者我们将应用程序逻辑分解为太多不同的项目。似乎最近开始成为一个重大的性能问题。

4 个解决方案

#1


5  

Having too many DLL files can cost you at run-time so I would recommend that you try to minimize the amount of projects. 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.

有太多的DLL文件可能会在运行时花费你,所以我建议你尽量减少项目的数量。创建多个解决方案也是一种选择,但尝试使解决方案彼此独立,这样您就不必在多个解决方案中调试和实现新功能 - 这可能很麻烦。

Take a look at this article: Project anti-pattern: Many projects in a Visual Studio Solution File.

看一下这篇文章:Project anti-pattern:Visual Studio Solution File中的许多项目。

#2


1  

Is there a chain of dependency through all 25 projects? If some projects aren't dependent on others, put them in their own solution.

所有25个项目都有依赖链吗?如果某些项目不依赖于其他项目,请将它们放在自己的解决方案中。

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.

除非您计划达到断点,否则请使用“不启动调试”。

Are some DLLs stable and haven't changed in long time? They don't have to be in your solution either.

一些DLL是否稳定并且长时间没有变化?他们也不必在你的解决方案中。

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来跟踪依赖项,否则在一个项目中放置许多类可能会导致太多类依赖于其他类,从而使更改变得更难和更具风险。

#3


1  

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? A simple web site could only have 1 project while keeping the Data Tier, Business Tier, Presentation Tier all inside the same project.

但这里的主要问题是为什么你有26个项目?一个简单的网站只能拥有一个项目,同时保持数据层,业务层,表示层都在同一个项目中。

If you are splitting projects only for this 3 tier stuff, I suggest that you revise this. as an example, we have 3 projects for the 3 tier. 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. 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.

如果你只拆分这个3层的项目,我建议你修改它。例如,我们有3个3层项目。我们在单独组装中有3层的原因是我们正在考虑其他软件以便在我们的项目中使用数据层。将我们的业务层保留在主要演示项目之外允许我们轻松地对我们的业务层进行单元测试,同时将无用的依赖关系保留在presentatier层之外。

So, overall, keep projects under 10 and review if you can merge some projects togheter. It will both save you time at compile time AND at build time. It will also be more easy to manage those DLLs.

因此,总体而言,将项目保持在10以下,并审核是否可以将某些项目合并到一起。它将节省您在编译时和构建时的时间。管理这些DLL也会更容易。

#4


0  

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 ;-)

我会说它在构建时花费你而不是运行时。而且越少越快,但也许你并不总是建立所有这些。如果是这种情况,那么你应该减少金额。否则将它们分成不同的解决方案。然后只有构建服务器需要构建所有这些并且每日构建都需要整晚构建;-)

#1


5  

Having too many DLL files can cost you at run-time so I would recommend that you try to minimize the amount of projects. 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.

有太多的DLL文件可能会在运行时花费你,所以我建议你尽量减少项目的数量。创建多个解决方案也是一种选择,但尝试使解决方案彼此独立,这样您就不必在多个解决方案中调试和实现新功能 - 这可能很麻烦。

Take a look at this article: Project anti-pattern: Many projects in a Visual Studio Solution File.

看一下这篇文章:Project anti-pattern:Visual Studio Solution File中的许多项目。

#2


1  

Is there a chain of dependency through all 25 projects? If some projects aren't dependent on others, put them in their own solution.

所有25个项目都有依赖链吗?如果某些项目不依赖于其他项目,请将它们放在自己的解决方案中。

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.

除非您计划达到断点,否则请使用“不启动调试”。

Are some DLLs stable and haven't changed in long time? They don't have to be in your solution either.

一些DLL是否稳定并且长时间没有变化?他们也不必在你的解决方案中。

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来跟踪依赖项,否则在一个项目中放置许多类可能会导致太多类依赖于其他类,从而使更改变得更难和更具风险。

#3


1  

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? A simple web site could only have 1 project while keeping the Data Tier, Business Tier, Presentation Tier all inside the same project.

但这里的主要问题是为什么你有26个项目?一个简单的网站只能拥有一个项目,同时保持数据层,业务层,表示层都在同一个项目中。

If you are splitting projects only for this 3 tier stuff, I suggest that you revise this. as an example, we have 3 projects for the 3 tier. 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. 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.

如果你只拆分这个3层的项目,我建议你修改它。例如,我们有3个3层项目。我们在单独组装中有3层的原因是我们正在考虑其他软件以便在我们的项目中使用数据层。将我们的业务层保留在主要演示项目之外允许我们轻松地对我们的业务层进行单元测试,同时将无用的依赖关系保留在presentatier层之外。

So, overall, keep projects under 10 and review if you can merge some projects togheter. It will both save you time at compile time AND at build time. It will also be more easy to manage those DLLs.

因此,总体而言,将项目保持在10以下,并审核是否可以将某些项目合并到一起。它将节省您在编译时和构建时的时间。管理这些DLL也会更容易。

#4


0  

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 ;-)

我会说它在构建时花费你而不是运行时。而且越少越快,但也许你并不总是建立所有这些。如果是这种情况,那么你应该减少金额。否则将它们分成不同的解决方案。然后只有构建服务器需要构建所有这些并且每日构建都需要整晚构建;-)