Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 speed big solution

Can you please advice how I can speed up a compiling, loading big solution (~50 projects). I mean only VS 2012 studio or Windows settings, not hardware changes.

Thanks

like image 861
Alexandr Avatar asked Jan 16 '13 09:01

Alexandr


People also ask

Why does Visual Studio take so long to run?

One of the reasons, is Visual Studio keeps rebuilding the same dependent project(s) over and over although nothing has changed. Imagine a Solution having tons of Projects that keep being built for no apparent reason. This wastes HUGE time...

Why is Visual Studio so heavy?

This is mainly because Visual Studio has lots of components, extensions and tools. This includes: ASP.NET and web development.


2 Answers

Consider your need for 50 projects in one solution - having many projects that are referenced by each other is one of the main reasons for slowdowns.

One of the few valid reasons to have separate projects is because you need to deploy the generated assemblies separately. If this is not the case, consider combining projects - use folders for the logical separation.

The lower the number of projects, the faster your build will become.

In addition, if you change the builds to output to a specific shared directory and reference the DLLs instead of the projects, the number of unneeded re-compilations should go down drastically, though you will have to manage the build order yourself.

like image 188
Oded Avatar answered Sep 30 '22 17:09

Oded


I use 100+ projects in a solution with Visual Studio 2012 Update 3, and it builds fast.

  1. I agree with shared output directory comment by Oded, but I'd like to mention that project references work OK too.
  2. Make sure that your \Users\\AppData\Local\Microsoft\WebsiteCache folder is empty. Somehow, this is a problem even with desktop-only solutions.
  3. I have disabled Productivity Power Tools 2012, since they compile code in the background, a bit too much for my liking. Disable all plug-ins and extensions and see if it makes any difference.
  4. Suppress excessive output messages to disk and to screen by reducing output verbosity Build-n-run
  5. Use multicore with MSBuild.
  6. As you code, try to limit dependencies between projects by using interfaces and abstract classes (C#).
  7. Try fresh *.suo and fresh *.sdf files. (Make a backup of the user settings and DB, then remove them and try building again)
  8. When all else fails, use ProcessMonitor or attach with another instance of Visual Studio to profile your Visual Studio while it's building.
  9. Try excluding file system filters, such as antivirus, from your build. For example, some antiviruses have a way of skipping scanning in certain directories or by file names.
like image 27
GregC Avatar answered Sep 30 '22 16:09

GregC