visual-studio 如何加快具有大量项目的 Visual Studio?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/242318/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 09:49:29  来源:igfitidea点击:

How do I speed up visual studio with a large number of projects?

visual-studiovisual-studio-2005

提问by leora

Visual Studio 2005 is very slow with a solution with 21 projects. Any ideas how to speed it up?

Visual Studio 2005 非常慢,有 21 个项目的解决方案。任何想法如何加快速度?

采纳答案by Glenn Slaven

There are a whole bunch of suggestions in this question: Very slow compile times on Visual Studio. A combination of a few of these will definitely help to some degree

这个问题有很多建议:Visual Studio 上的编译时间很慢。其中一些的组合肯定会在某种程度上有所帮助

回答by sliderhouserules

ScottGu has saidhard drive speed is one of the most important factors in VS performance. When we got new computers at work recently I requested that they have a second top-of-the-line hard drive. My Development folder is on my D: drive and VS loads and compiles 20+ project solutions in a matter of seconds.

ScottGu 曾表示,硬盘速度是影响 VS 性能的最重要因素之一。当我们最近在工作中使用新计算机时,我要求他们有第二个顶级硬盘驱动器。我的 Development 文件夹在我的 D: 驱动器上,VS 可以在几秒钟内加载和编译 20 多个项目解决方案。

回答by abjbhat

I don't have VS open in front of me right now...but its roughly this...

我现在没有在我面前打开 VS ......但它大致是这样......

Go to..

去..

Tools > options > Build and release options.

工具 > 选项 > 构建和发布选项。

Select - build startup project and dependencies only.

选择 - 仅构建启动项目和依赖项。

This will significantly speed up the process.

这将大大加快进程。

回答by bh213

I did some performance testing on build speed (VS2008 though).

我对构建速度进行了一些性能测试(尽管是 VS2008)。

I tried using RAM Drive. Almost no difference from RAID 1+0.

我尝试使用 RAM 驱动器。与 RAID 1+0 几乎没有区别。

Quad core doesn't seem to help much as CPU is never at 100% (well, one of them is at 100% I guess). CPU frequency seems to help though. Not sure about memory speed.

四核似乎没有多大帮助,因为 CPU 永远不会达到 100%(好吧,我猜其中之一是 100%)。不过,CPU 频率似乎有所帮助。不确定内存速度。

So, to speed it up, consolidate some projects (since having same amount of .cs files builds slower if they are in separate projects) or create sub-solutions - solutions that only hold dependancies for your current work project. So, say you have Web app and admin app and some sort of WPF UI client, create 3 solutions, one with web app, one with admin and one for client.

因此,为了加快速度,请合并一些项目(因为相同数量的 .cs 文件在单独的项目中构建速度会变慢)或创建子解决方案 - 仅对当前工作项目保持依赖关系的解决方案。因此,假设您有 Web 应用程序和管理应用程序以及某种 WPF UI 客户端,请创建 3 个解决方案,一个带有 Web 应用程序,一个带有管理员,一个用于客户端。

回答by Aaron Powell

Here's some good tips on improving VS compile speed:

这里有一些关于提高 VS 编译速度的好技巧:

  • Disable StyleCop, FxCop or any other code analysis tools
  • Create multiple build configurations, one for each of the tasks you perform and only compile what you need in each particular configuration
  • Remove unneeded MSBuild tasks
  • 禁用 StyleCop、FxCop 或任何其他代码分析工具
  • 创建多个构建配置,为您执行的每项任务创建一个配置,并且仅在每个特定配置中编译您需要的配置
  • 删除不需要的 MSBuild 任务

回答by cbp

a) Buy more memory b) Break up into different solutions c) Upgrade to VS 2008 d) http://geekswithblogs.net/Ahmed_Hussein_blog/archive/2007/11/12/116791.aspx

a) 购买更多内存 b) 分解成不同的解决方案 c) 升级到 VS 2008 d) http://geekswithblogs.net/Ahmed_Hussein_blog/archive/2007/11/12/116791.aspx

回答by torial

Upgrading to 2008 is worth it for your situation. At my last job, we had 50 projects, and VS 2005 was dog slow. Plus it was a pain to debug (w/ multithreading). The IDE kept blowing up on us. As soon as we upgraded to VS 2008, everything went faster, the compiles went faster (partially because MS implemented a smart parallelization algorithm by the looks of it), it uses less RAM, and is far more stable.

对于您的情况,升级到 2008 是值得的。在我的上一份工作中,我们有 50 个项目,而 VS 2005 非常缓慢。另外调试起来很痛苦(使用多线程)。IDE 一直对我们大发雷霆。我们升级到 VS 2008 后,一切都变得更快了,编译也变得更快了(部分原因是 MS 从外观上实现了智能并行化算法),它使用的 RAM 更少,并且更加稳定。

The only regret we had with 2008 is in the C++ end of things (most of our app was VB.Net, some C#, and some C++). The new version of C++ doesn't support Windows NT which we needed to do. The workaround is a postevent that uses an old Edit Bin and sets the version for 4.0.

我们对 2008 年唯一的遗憾是在 C++ 端(我们的大部分应用程序是 VB.Net、一些 C# 和一些 C++)。新版本的 C++ 不支持我们需要做的 Windows NT。解决方法是使用旧的 Edit Bin 并将版本设置为 4.0 的 postevent。

回答by Sam Harwell

Hotfix 947315for Visual Studio 2005.

Visual Studio 2005 的修补程序 947315

This is a cumulative fix for the following:

这是针对以下问题的累积修复:

  • KB947315:The Visual Studio 2005 IDE stops responding when you work with Visual C++ projects
  • KB943969:Visual Studio 2005 stops responding or performance is slow when you use the IntelliSense feature
  • KB916769:The Visual Studio 2005 IDE stops responding when you work with a large Visual C++ .NET solution in Visual Studio 2005
  • KB947315:当您使用 Visual C++ 项目时,Visual Studio 2005 IDE 停止响应
  • KB943969:当您使用 IntelliSense 功能时,Visual Studio 2005 停止响应或性能变慢
  • KB916769:当您在 Visual Studio 2005 中使用大型 Visual C++ .NET 解决方案时,Visual Studio 2005 IDE 停止响应