Reputation: 51
We have over 100 projects in a Solution and some of the projects include other projects as project references. The Clean-Build/Rebuild took too much time, so I searched and found a pretty good solution for optimizing the build/rebuild time:
After multiple testing, I have found out that the VS Solution's rebuild fails 30% of the time due to metadata * could not be found
.
I know what the error means, but I do not know how it comes to that.
Has anybody any idea, how to improve the success of Solution's Rebuild?
Upvotes: 0
Views: 135
Reputation: 309
Frequent problem with rebuilds failing sometimes is (as has been noted in the comments) parallel builds, when there are dependencies between projects (i.e. one build target requires other projects to be built first, as it consumes the output of the projects.)
It is possible to set build dependencies in VS - VS version isn't stated, but you should be able to right click on a project, and select 'Build Dependencies' - which then gives you two options: Build Dependencies, and Build Order.
Using these options you can define which projects depend on others (i.e. prevent VS from trying to build projects where the ones on which it depends haven't yet been built) and, if you need to, specify a specific order for projects to build in.
Provided you get your dependencies right, it should ensure the correct ordering, without sacrificing the parallel build (which, with so many projects, you're going to want to keep, I suspect.)
See: How to: Create and Remove Project Dependencies
Upvotes: 2