We have encountered this topic many a times among freshers and a couple of year’s experienced professionals as well. Some programmers have made this a habit of doing clean + build every time they change code without knowing the significance of it. Some of them always prefer to do a rebuild every time the change or modify some part of code.
With the help of this post, we are trying to list out the significance of each – build, rebuild & clean options and make readers understand when to use them.
Build solution will always perform an incremental build. i.e It will only build those files which have changed. The files which aren’t modified or changed won’t be build.
Rebuild solution will delete all the compiled files(DLLs and EXE) and will perform build from scratch irrespective of whether the files are modified or not.It is a combination of Clean + Build.
Clean solution will delete all the compiled files(DLLs and EXE) from bin/obj directories.
The Difference:Clean + Build = Rebuild Click To Tweet
The difference lies in the way the build and clean happens for every project. For example, if the solution has two projects – Project 1 & Project 2 and you do a rebuild, it will take Project 1, clean (delete) the compiled files for Project 1, and build it. After that it will take Project 2, clean the files for Project 2, and build it.
On the other hand, if you do a clean and build, it will first clean (delete) all compiled files(DLLs and EXE) for both the projects – Project 1 & Project 2 and then it will build Project 1 first, followed by Project 2.
We hope the difference between build rebuild and clean is clear. If you have any doubts related to the post, please mention it in comments below.
What do you think?
If you have any questions or suggestions please feel free to email us or put your thoughts as comments below. We would love to hear from you. If you found this post or article useful then please share along with your friends and help them to learn.