Skip to main content
Difference between build rebuild and clean in visual studio

Difference between build rebuild and clean in visual studio

 

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:

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:

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:

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.

Diagrammatic representation:

Difference between build rebuild and clean in visual studio

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?

Dear Reader,
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.

Happy Coding!

DotNetCrunch

DotNetCrunch is a popular blog for latest Microsoft® technologies which is aimed for beginners and intermediate level professionals.

  • Ajay Malik

    Please tell best software for making html plugins for my blogspot site wastatus.com

    • Your site is made using blogger. So you can use from the plugins available for blogger. We are not sure on how to create those plugins. WordPress plugins are created using PHP.

      • Ajay Malik

        Did you tell me to make javascript plugin software for my website

  • Pingback: .NET Interview Questions - DotNetCrunch()