Monday, July 2, 2018

Difference between Build, Rebuild and Clean Solution

  • Build Solution     – Incremental build and compiles only the files that are changed.
                                          Compiles code files (DLL and EXE) which are changed.
  • Clean Solution    – Deletes all compiled, intermediate files (DLL and EXE file) .         
  • Rebuild Solution – Deletes all compiled files and compiles all irrespective of changes.                                  

Build Solution

This is the faster option to compile and run your solution in Visual Studio. When you opt for the BuildVisual Studio will perform an incremental build.  What does it mean ?
  • Builds any assemblies which have changed files from the last build. If there an assembly which has no changes, it won’t be re-built.
  • During the Build option, Visual Studio won’t  delete any intermediate files.

If here is no changes, and try to build it again, it will display message like below – which says .. all the code base are up-to-date

Incase there are multiple projects, all up-to-date projects will be skipped and only the changed files will be built.

Rebuild Solution

As mentioned earlier, rebuild a solution is nothing but clean and build each project in the solution.

Rebuilding a solution first does the “Clean Solution” then execute the “Build Solution” for each project.

Clean Solution
This will remove all intermediary, complied files and clean up the output directories (bin / obj folders) from any previous builds.

Build vs Rebuild

The difference is the way the build and clean sequence happens for every project. Let’s say 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 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”.

No comments:

Post a Comment

How to enable the dimension fields based on the Item selected on the form.

[Form] public class KMTShipFromWarehouses extends FormRun {     InventDimCtrl_Frm_EditDimensions        inventDimFormSetup;     /// &l...