In this article we will look into the difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio.
In Visual Studio, there are three options for building a solution: Build Solution, Rebuild Solution, and Clean Solution. Each option has a different purpose and performs different actions.
Build Solution:
The Build Solution option compiles only those source files that have been modified since the last build. If the project has already been built once, Visual Studio will only compile those source files that have changed.
If no changes have been made, Visual Studio will not compile anything. This is the quickest and most efficient way to build a solution.
Rebuild Solution:
The Rebuild Solution option is used to clean and rebuild the entire solution, regardless of whether or not any source files have changed.
This option is useful when you want to ensure that the entire solution is compiled from scratch, regardless of the current state of the project.
When you use the Rebuild Solution option, Visual Studio will delete all compiled files and then compile all source files from scratch.
Clean Solution:
The Clean Solution option is used to delete all compiled files for a solution, without building anything. This option does not compile any source files, but instead deletes all previously compiled files, including object files, libraries, executables, and other build artifacts.
This option is useful when you want to start with a clean slate and ensure that all compiled files are deleted before a new build.
Finally, the Build Solution option only compiles source files that have changed since the last build, the Rebuild Solution option deletes all compiled files and compiles everything from scratch, and the Clean Solution option deletes all compiled files without building anything.