пятница, 3 января 2014 г.

Visual Studio : Build Solution, Rebuild Solution and Clean Solution

I always thought of what is the difference in Build, Rebuild and Clean Solution and which one is appropriate to use at which time?

So I tried to find the reason and here is my findings.

Clean solution

will remove the build intermediate files from the previous build. If there are any other files in the build target directories like bin and obj they may not be removed, but actual build artifacts will be removed. 

Build solution

will build assemblies, if there is no change in assembly after previous build then it would not build the assembly. So it use partially-built wherever changes occurred after previous build.


Rebuild solution

will clean and then build the solution from scratch, regardless of changes has been occurred or not.



Here comes another question, rebuild will clean and then build the solution, so Is it equivalent to Clean Solution and then Build the solution?


Actually No!!! they are not equal. 

The difference is in the sequence projects get clean and build. Let say we have two projects in a solution. Clean and then build will perform clean to both projects and then build will occur individually while on rebuild project A will get and clean and then build after that project B will be clean and then build and so on.


If you have any comments please do post.

Комментариев нет: