Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

What is the difference between build and rebuild a project?

Posted on 2007-03-28
2
Medium Priority
?
397 Views
Last Modified: 2013-11-26
Hi,

I want to ask that what is the difference between build and rebuild a project in Visual Studio.
And I what is the difference between debug and trace.

And also I want to here more about this kind of terms that comes in programing, advice me some resource that clearly describe.

thanks.
0
Comment
Question by:karanba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 280 total points
ID: 18814692
Build is not suppose to process files that haven't changed since last compilation. Rebuild don't check that, it recompiles everything.

Debug is only in the debug configuration while Trace is available is available in Debug and Release configuration.
0
 
LVL 19

Assisted Solution

by:mrwad99
mrwad99 earned 220 total points
ID: 18814696
I am going to answer this in terms of C++.

When you build a project in VS, if the project has not been built before, you will find that not only do you get your EXE or DLL generated, but you also get various intermediary files too.  These will have extensions .obj (object files) .pdb (program database files) and possibly .ilk (incremental link files).  Each time you build the project, these will get updated.

So.  Say you have a solution that has one DLL, and one executable.  You build the DLL and the executable together by building the solution, then discover that you need to change the executable code somewhat.  So, you make the code changes in the EXE and build the solution.  This time, you will see that the DLL is not built; it has not been changed - so why would it be?  The executable is rebuilt however, to encorporate the changes you just made.  Now try a rebuild.  This time, both the DLL and the EXE are built, as you are essentially saying to VS "even if a project has been built, I want you to build it again".

So why did I mention the intermediary files?  You will notice that a rebuild first performs a *clean*, which removes all the output files generated by the last build (if there was one) then performs the build.  So, all the .obj, .pdb etc files will be regenerated, even if there are no changes that require this.

This is why a rebuild takes no longer than a normal build.  There are advantages to this however.  Sometimes I find the strangest of crashes/inconsistences, that are solved when I do a rebuild, possibly due to the various DLL/EXE files becoming out of step.  Also, a rebuild is essential when porting code from an older compiler - you dont want to be using binaries built in one compiler with those built in another, as there may be issues such as updates to various header files meaning structure size differences/different alignment of variables, which could cause very hard to diagnose problems.

HTH
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Introduction to Processes

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question