views:

309

answers:

5

hi, i am building a solution with approximately 100 assemblies that is taking a considerable amount of time to compile. I would say in the realm of minutes per assembly. This is in contrast to another product also with 100+ assemblies that will take seconds to move through each one.

In both cases there are complex dependencies and multiple references and in the 2nd case the project is actually larger which doesnt seem to make sense.

I have looked over the CSPROJ files and SLN files and cannot see anything obvious that would stall the compile.

I am building in VS2008 Professional Edition.

NB: Using NANT scripts that use MSBUILD.exe works exponetially faster -> So something in VS is causing a major slowdown.

Does any one have any sugestions as opposed to recreating the entire solution from scratch?

Thanks.

+3  A: 

Do you have anything in the dependencies which is forcing lots of projects to be rebuilt each time? For instance, if you have a pre-build step which runs some code generation, and everything relies on that project, that could be a killer. I ran into that situation a while ago - making the code generator notice when its inputs hadn't changed, and not rewriting the output in such cases, saved loads of time.

As an aside, do you really need 100 projects in the same solution? That's going to be pretty slow whatever you do, I think. I'd considering either trying to amalgamate projects (I've seen various situations where people had lots and lots of tiny projects - merging them really helped) or split the single solution into several.

EDIT: One thing you might like to try to take the GUI part of Visual Studio out of the equation is build it with msbuild from the command line, without VS running at all.

Jon Skeet
Many of the dependencies are similar to that of the 2nd example project mentioned earlier and that builds fine. Looking closer i cant see anything strange. Re: your 2nd point, agreed. And looking to amalgamate assemblies in the future.
Grant
A: 

Do you have any Visual Studio plug-ins that might be doing something like indexing the files as they build?

Have you set the options to use all of the processors that you have available on your machine?

Are there any other processes running on your machine that might be stealing CPU cycles or hogging the hard drive? You can use Task Manager or Process Explorer to look for those.

onedozenbagels
Hi, no there are no plugins or anything like that. I am part of a team of developers and at least 4 or us are having the same problem in isolated and unique environments.....
Grant
+2  A: 

Maybe use a tool like FileMon to monitor what VS is writing/reading while it is delaying. Maybe that will give you a clue. I found it very useful in understanding what applications are doing (assuming there is I/O activity to monitor)

Ron Harlev
thanks Harlev, will give it a shot
Grant
A: 

Does the slow solution have a lot of ASP.NET files/projects? Compiling tags always seems to take longer than pure C#/VB

Jonathan Parker
no its a winforms / class library application. c# and vb.net
Grant
+2  A: 

Found out that the project files were referecing network paths instead of local paths. changing these values set the build time back to normal. Thanks all who replied.

Grant