How to speed up build time by *only* building the currently selected project in a multi-project solution?

Posted by Unknown
How to speed up build time by *only* building the currently selected project in a multi-project solution?

when we work on the solution which is having the multiple projects building time taking too long to build every time we need to wait for the some time to build all the projects.

Today i have searched and found the solution is that to avoid this building time we need set properties


We’ll start with a solution that has two projects – WebApplication_1 and WebApplication_2.
First, we’ll configure VS to set the “Startup Project” as the “Current selection” in the “Solution Explorer” window. You can configure this via the Properties settings of a solution file (right click on it) and then setting the “Startup Project” to “Current selection”. Now, the project highlighted in the “Solution Explorer” is the one that’s run by default.
CurrentSelection

Let’s run WebApplication_1 by selecting it in Solution Explorer.
TwoProjectsInSolution

Next, we’ll do a CTRL+F5. The VS output window shows:
Build

Notice that we’ve built two projects yet I only wanted to run one of them and there’s no dependency configured between the two. Visual Studio by default builds all of the projects in a solution. You can imagine the delay you might incur if you had a solution with numerous projects and if some of these included pre- or post-build tasks.
Thankfully, there’s a way to change this.
Under “Tools –> Options”, “Projects and Solutions” (might need to check “Show all settings”), there’s a setting called “Only build startup projects and dependencies on Run”. Check that box.
OnlyBuild
BuildJustOne

Now, if we return to our solution and repeat trying to run just WebApplication_1, we see that VS only builds that project and not the other one as well.

Labels: , ,

Post a Comment

 
test