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?
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?
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. Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful. In practice, you never need to Clean.
Build solution will build any projects in the solution that have changed. Rebuild builds all projects no matter what, clean solution removes all temporary files ensuring that the next build is complete.
Build Solution - Builds any assemblies which have changed files. If an assembly has no changes, it won't be re-built. Also will not delete any intermediate files.
Used most commonly.
Rebuild Solution - Rebuilds all assemblies regardless of changes but leaves intermediate files.
Used when you notice that Visual Studio didn't incorporate your changes in the latest assembly. Sometimes Visual Studio does make mistakes.
Clean Solution - Delete all intermediate files and rebuild all assemblies regardless of changes
Used when all else fails and you need to clean everything up and start fresh.
(The links are to the devenv.exe command line switches, but they do the same as the menu items.)
I just think of Rebuild as performing the Clean first followed by the Build. Perhaps I am wrong ... comments?