Author : Rahul
Last Modified : 31-Jul-2020
Complexity : Beginner

Difference between Build, Rebuild and Clean Solution in Visual Studio


Hello, I am going to explain the difference between Build, Rebuild, and Clean Solution in Visual Studio.

Build Solution

  • It will perform an incremental build.
  • Suppose there are 3 projects in 1 solution. A user performs some changes in only 1 project. In that case, when the user performs Build Solution, only 1 project which is updated after the last build, will be Build.
  • It compiles the code files (DLL and EXE) which are changed.

Rebuild Solution

  • It will clean and then build the solution from scratch.
  • Suppose there are 3 projects in 1 solution. A user performs some changes in only 1 project. In that case when the user performs Rebuild Solution, firstly all three projects will be cleaned and then all three projects will be Build.
  • It deletes all the compiled files (DLL and EXE) and compiles them again irrespective if the code has changed or not.

Clean Solution

  • It will remove the build artefacts from the previous build.
  • Suppose there are 3 projects in 1 solution. A user performs some changes in only 1 project. In that case, when the user performs Clean Solution, compiled files (DLL and EXE file) for all 3 projects will be deleted.
  • It deletes all compiled files (DLL and EXE file).