Welcome Login

Build, rebuild and clean solution in visual studio


Build solution:

Compiles code files (dll and exe) which are changed.

ie: build means compile and link only the source files that have changed since the last build.

Builds any assemblies which have changed files. If an assembly has no changes, it won't be re-built. Also will not delete any intermediate files.

Build solution will perform an incremental build.

Note: Build is the normal thing to do and is faster.

 

 

Rebuild:

Deletes all compiled files and compiles them again irrespective if the code has changed or not.

Rebuild means compile and link all source files regardless of whether they changed or not.

Rebuilds all assemblies regardless of changes but leaves intermediate files.

ie: Rebuild = Clean + Build.

Rebuild solution will clean and then build the solution from scratch, ignoring anything it's done before.

 

Note: Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful.

 

 

Clean solution:

Delete all compiled files (dll and exe), ie: delete all intermediate files.

Clean will remove the build artefacts from the previous build.

If there are any other files in the build target directories (bin and obj) they may not be removed, but actual build artefacts are.

 

Note: In practice, you never need to clean.

 

 

 

Building executables:

Building is the process of turning your source code text files into one or more files called targets (.exes) that are used when your application runs.

Eg:

A single target .exe file can be produced by compiling source files into intermediate object .obj files, which are then linked with various library files (.lib) and dlls.

 

 

Build menu:

vs-buildmenu1


Build or rebuild solution builds or rebuilds all projects in the your solution, while Build or Rebuild <project name> builds or rebuilds the StartUp project, 'WebAdmin'.

To set the StartUp project, right click on the desired project name in the solution explorer tab and select Set as StartUp project.

The project name now appears in bold.

 

 

For more information, see here.

And here.


Created on: Thursday, February 27, 2014 by Andrew Sin