Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a "build" and a "rebuild" in Visual Studio?

I do not know if i understood right , the difference between a "build" and "rebuild" command of a project in Visual Studio is the fact that a build only compiles the code which was changed , since a "rebuild" command compiles all the code from project regardless is it was changed or not.

Also a rebuild command includes a clean of the project, since build command does not ?

Please advice me to understand better these differences.

Thanks !

like image 276
Mircea Avatar asked Dec 11 '10 13:12

Mircea


People also ask

What is the difference between build and rebuild?

Taken from this link: Build means compile and link only the source files that have changed since the last build, while Rebuild means compile and link all source files regardless of whether they changed or not. Build is the normal thing to do and is faster.

Is rebuild the same as clean and build?

For a multi-project solution, "rebuild solution" does a "clean" followed by a "build" for each project (possibly in parallel). Whereas a "clean solution" followed by a "build solution" first cleans all projects (possibly in parallel) and then builds all projects (possibly in parallel).

What is build rebuild and clean solution in Visual Studio?

To build, rebuild, or clean an entire solutionChoose Build All to compile the files and components within the project that have changed since the most recent build. Choose Rebuild All to "clean" the solution and then builds all project files and components. Choose Clean All to delete any intermediate and output files.

What is meant by build in Visual Studio?

A build definition is the mechanism that controls how and when builds occur for team projects in TFS. Each build definition specifies: The things you want to build, like Visual Studio solution files or custom Microsoft Build Engine (MSBuild) project files.


1 Answers

Also a rebuild command includes a clean of the project, since build command does not ?

You have identified the fundamental difference.

Build will look at the files that have been modified since the last successful compile and link and just compile those and then link the result.

Rebuild will recompile everything.

Strictly speaking it might be different to a clean (which removes the intermediate and output files) and build and just recompile everything, but the result should be the same. However, there may be cases that fail (see Femaref's comment).

like image 63
ChrisF Avatar answered Oct 08 '22 05:10

ChrisF