Solved

What is the difference between build and rebuild a project?

Posted on 2007-03-28
2
384 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 70 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 55 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Progress

705 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