Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio?

What is the difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio?

When is the appropriate time to use each one of these?

like image 214
Fawa Avatar asked Jun 22 '10 18:06

Fawa


People also ask

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 the difference between build and clean build?

Clean Solution : deletes all compiled files (all dll's and exe's ). Build Solution : compiles code files (dll and exe) that have changed.

What is the difference between build and rebuild?

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.

What is clean and rebuild project in VS code?

On the menu bar, choose Build, and then choose either Build ProjectName or Rebuild ProjectName. Choose Build ProjectName to build only those project components that have changed since the most recent build. Choose Rebuild ProjectName to "clean" the project and then build the project files and all project components.


1 Answers

  • Build solution will perform an incremental build: if it doesn't think it needs to rebuild a project, it won't. It may also use partially-built bits of the project if they haven't changed (I don't know how far it takes this)
  • Rebuild solution will clean and then build the solution from scratch, ignoring anything it's done before. The difference between this and "Clean, followed by Build" is that Rebuild will clean-then-build each project, one at a time, rather than cleaning all and then building all.
  • Clean solution will remove the build artifacts from the previous build. If there are any other files in the build target directories (bin and obj) they may not be removed, but actual build artifacts are. I've seen behaviour for this vary - sometimes deleting fairly thoroughly and sometimes not - but I'll give VS the benefit of the doubt for the moment :)

(The links are to the devenv.exe command line switches, but they do the same as the menu items.)

like image 155
Jon Skeet Avatar answered Sep 25 '22 01:09

Jon Skeet