What is the difference between just a Rebuild and doing a Clean + Build in Visual Studio 2008? Is Clean + Build different then doing Clean + Rebuild?
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).
Clean Solution : deletes all compiled files (all dll's and exe's ). Build Solution : compiles code files (dll and exe) that have changed.
The main difference between build and rebuild in Visual Studio is that the build helps to complete the code files that are changed, while rebuild deletes all previously compiled files and compiles the solution from scratch, ignoring anything done before.
To build, rebuild, or clean an entire solution Choose 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.
Rebuild = Clean + Build (usually)
Notable details:
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). This difference in sequencing of events can become significant when inter-project dependencies come into play.
All three actions correspond to MSBuild targets. So a project can override the Rebuild action to do something completely different.
Earl is correct that 99% of the time Rebuild = Clean + Build.
But they are not guaranteed to be the same. The 3 actions (rebuild, build, clean) represent different MSBuild targets. Each of which can be overriden by any project file to do custom actions. So it is entirely possible for someone to override rebuild to do several actions before initiating a clean + build (or to remove them entirely).
Very much a corner case but pointing it out due to comment discussions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With