Venkat
Venkat

Reputation: 878

visual studio 2008 build optimization

In single solution we having 100 projects, if we build solution its taking lots of time to build. I want to know do we have options to increase speed of visual studio build process.

Language used for development c#.

Upvotes: 3

Views: 923

Answers (3)

AlainD
AlainD

Reputation: 6607

Ensure the anti-virus is not interfering with the build. Following instructions are for Windows Defender on Windows 10 22H2 (should be similar for other AV and Windows 11):

  • Close Visual Studio
  • Windows Settings > Update & Security > Windows Security > Virus & threat protection
  • Virus & threat protection settings > Manage settings
  • Exclusions > Add or remove exclusions
  • Add a 'Folder' exclusion for {YourCodeFolder}
  • Add 'Process' exclusions for 'devenv.exe' and 'MSBuild.exe'
  • Close Windows Settings
  • Restart Visual Studio

For my Visual Studio 2008 C# project, build times reduced from >5 minutes to ~10 seconds.

Upvotes: 0

ryber
ryber

Reputation: 4555

A lot of the time in a large solution like that is copying dependencies around to all the various bins. You can shorten the time significantly by pointing all of the outputs to the same directory rather than the local bins.

  1. right click on each project >> properties >> Build
  2. Under "Output" change the path to a common directory. We use ".._builds\bin\Debug\"

Upvotes: 0

iCollect.it Ltd
iCollect.it Ltd

Reputation: 93571

We have nearly 100 projects in one solution and a dev build time of only seconds :)

For local development builds we created a Visual Studio Addin that changes Project references to DLL references and unloads the unwanted projects (and an option to switch them back of course).

  • Build our entire solution once
  • Unload the projects we are not currently working on and change all project references to DLL references.
  • Before check-in change all references back from DLL to project references.

Our builds now only take seconds when we are working on only a few projects at a time. We can also still debug the additional projects as it links to the debug DLLs. The tool typically takes 10-30 seconds to make a large number of changes, but you don't have to do that often.

Upvotes: 3

Related Questions