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?
Build solution only builds those projects which have changed in the solution, and does not effect assemblies that have not changed,
ReBuild first cleans, all the assemblies from the solution and then builds entire solution regardless of changes done.
Clean, simply cleans the solution.
Build Solution - Build solution will build your application with building the number of projects which are having any file change. And it does not clear any existing binary files and just replacing updated assemblies in bin or obj folder.
Rebuild Solution - Rebuild solution will build your entire application with building all the projects are available in your solution with cleaning them. Before building it clears all the binary files from bin and obj folder.
Clean Solution - Clean solution is just clears all the binary files from bin and obj folder.
Build solution
This will perform an incremental build. In other words it will only build code files which have changed. If they have not changed those files will not be touched.
Rebuild solution
This will delete all currently compiled files (i.e., exe and DLLs) and will build everything from scratch, irrespective of if there is code change in the file or not.
Clean solution menu
This menu will delete all compiled files (i.e., EXE’s and DLL’s) from the bin/obj directory.
Rebuild = Clean + Build
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 changesUsed when all else fails and you need to clean everything up and start fresh.
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.
I just think of Rebuild as performing the Clean first followed by the Build. Perhaps I am wrong ... comments?