Alexandr
Alexandr

Reputation: 1460

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

Upvotes: 8

Views: 9044

Answers (2)

GregC
GregC

Reputation: 7977

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.

Upvotes: 5

Oded
Oded

Reputation: 498904

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.

Upvotes: 7

Related Questions