visual studio

Visual Studio: Why Clean, Build, & Rebuild?

One of the most commonly used and least thought features that developers working in Visual Studios use is “Clean, Build, and Rebuild.” When asked, most developers can describe which to use and when, but do not know exactly why. On certain projects if this is not set up properly it may  make development difficult. So what do these features do?

My simple explanations:
 
  • Clean Solution - deletes all compiled files (all dll’s and exe’s ).
  • Build Solution - compiles code files (dll and exe) that have changed.
  • Rebuild Solution - Deletes all compiled files and Compiles them again regardless of whether or not the code has changed.

The biggest points to note are not just what these things do, but how they do them. The differences come into play when considering the order in which the sequence is performed. For the “Rebuild” option, it will “Clean” then “Build” one project at a time in the set build order. With the “Clean” and “Build” approach, it will first completely clean every project in the solution then build it back in the set build order, see the example illustration:
 

Needless to say this is important to keep in mind because if certain dll’s or exe’s are not available when other projects try to build, it will fail causing you issues.
Comments
 
comments powered by Disqus

Author

Wiz E. Wig, Mascot & Director of Magic
Wiz E. Wig

Director of Magic

Read more