In Visual Studio, how to make an incremental build as fast as a debug-session-triggered build?

I have a Visual Studio 2010 solution with 40 different projects in it (C # + one C ++ / CLI). I have Visual Studio configured in such a way that it creates an entire solution before starting debugging.

Now suppose that I am changing the code for a leaf project that no other project depends on. When I explicitly create the solution step by step ( F6 or F7 ), I see the assembly output line for each project in my solution. However, updated projects are not recompiled. For example, you do not see a warning for projects. It takes time (maybe 5-10 seconds).

Now suppose I change the same file again and start debugging ( F5 ). Now something else is happening. Only the modified project is recompiled (takes 1 second or so), and then debugging starts almost instantly.

Visual Studio seems to have two strategies for incremental builds, and optimal optimization seems only available as a by-product of a debugging session.

Question:

Is there a way to bring out this more optimized build strategy manually without starting a debugging session?

+7
source share
1 answer

When debugging, it only builds a project that will be debugged. When you build a solution, it builds all the projects in the solution. There are checks associated with each project, even if nothing is done. These steps in the assembly process, even if no assembly actions are taken, are explained by the fact that it takes more time to build a solution.

If you go to Tools-> Options ... and look under "Projects and Solutions" → "Build and Run", a parameter called the output of the MSBuild project build, which is set to Normal or higher, will be given to give you some idea what actually when you create vs debug. You will need to display the output window and set this to show the output of the assembly in order to view information from this parameter.

You can build the current project by pressing Shift + F6, this should have the same speed.

+2
source

All Articles