Click here to Skip to main content
11,631,212 members (77,905 online)
Click here to Skip to main content

Build solution vs. Rebuild solution vs. Clean solution Menu

, 22 Jul 2013 CPOL 37K 15
Rate this:
Please Sign up or sign in to vote.
I had a very vague idea, but I wanted to be sure about the exact differences between them.

I am not aware of a single day in my life when I have not clicked on the Build, Rebuild, or Clean menu of Visual Studio. Even though I use it on a daily basis or sometimes even on a minute to minute basis when my keyboard is high on coding, I am still not clear what exactly each one of these menus does. I had a very vague idea, but I wanted to be sure about the exact differences between them.

When I hunted for the differences what came out was surprising, below goes a detailed explanation of the same.

Build solution menu

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 menu

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.

Now if you read the above three points I have discussed, you can conclude that:

Rebuild = Clean + Build

So the next question would be if you do a Rebuild and if you do Clean + Build, what is the difference?

The difference is the way the build and clean sequence happens for every project. Let’s say if your solution has two projects, proj1 and proj2. If you do a rebuild it will take proj1, clean (delete) the compiled files for proj1, and build it. After that it will take the second project proj2, clean the compiled files for proj2, and compile proj2.

But if you do a clean and build, it will first delete all compiled files for proj1 and proj2 and then it will build proj1 first, followed by proj2.

The below image explains the same in a more visual format.

Below is a simple YouTube video which demonstrates the difference between these entities. 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Shivprasad koirala
Architect http://www.questpond.com
India India

I am an ex-Microsoft MVP for ASP/ASP.NET and currently a CEO of a small
E-learning company in India. We are very much active in making training videos, writing books and corporate trainings. Do visit my site for 
.NET, C#, Design Pattern, WCF, Silverlight, LINQ, ASP.NET, ADO.NET, SharePoint, UML, SQL Server  training 
and Interview questions and answers


You may also be interested in...

Comments and Discussions

 
GeneralNice information at this early morning Pin
King Fisher21-May-15 18:51
professionalKing Fisher21-May-15 18:51 
QuestionWhen should I use each? Pin
AlexWang201016-Jan-15 9:25
memberAlexWang201016-Jan-15 9:25 
Generaldifferences in details Pin
Xaheer Ahmed20-Nov-13 21:39
memberXaheer Ahmed20-Nov-13 21:39 
QuestionInformative article Pin
Jon_Boy24-Jul-13 2:37
memberJon_Boy24-Jul-13 2:37 
GeneralMy vote of 5 Pin
zahid khan12323-Jul-13 22:54
memberzahid khan12323-Jul-13 22:54 
GeneralMy vote of 4 Pin
Arsalan Ahmad23-Jul-13 7:26
memberArsalan Ahmad23-Jul-13 7:26 
GeneralMy vote of 5 Pin
Maimonides22-Jul-13 22:18
professionalMaimonides22-Jul-13 22:18 
QuestionGermany Business Mailing List Pin
elistxs0822-Jul-13 20:44
memberelistxs0822-Jul-13 20:44 
GeneralMy vote of 5 Pin
Santhosh Kumar Jayaraman22-Jul-13 17:52
memberSanthosh Kumar Jayaraman22-Jul-13 17:52 
GeneralMy vote of 4 Pin
S.P. Tiwari22-Jul-13 1:51
memberS.P. Tiwari22-Jul-13 1:51 
SuggestionRe: My vote of 4 Pin
Stephen Inglish22-Jul-13 6:25
memberStephen Inglish22-Jul-13 6:25 
When you vote lower than 5, please the author what you were expecting that would have made it a five.
Stephen Inglish
MCPD: Windows Developer
MCPD: Web Developer
MCPD: Enterprise Developer

QuestionPerformance? Pin
Sharjith22-Jul-13 1:09
memberSharjith22-Jul-13 1:09 
GeneralGood Info Pin
sund7wells22-Jul-13 0:39
membersund7wells22-Jul-13 0:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150723.1 | Last Updated 22 Jul 2013
Article Copyright 2013 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid