views:

535

answers:

2

I am struggling with the purpose of the build configuration manager in Visual Studio 2008. Specifically I am interested in knowing what it does when developing a console application and also a web application (web application project). Does setting it to Debug or Release mode make any difference when you are developing and running the application in the context of VS2008? What does it to when you want to build the solution?

+2  A: 

The Build Configuration Manager allows you to set different combinations of project build options for a solution. For example, say you have a solution with 4 projects, log4net, a DAL, a Business layer and the Website. Most times you'll want to run the website and business layer in debug, but the DAL and log4net in release mode. Sometimes you'll want to run the DAL in debug too, but only on a rare occurrence will you want to run everything in debug. The config manager lets you define configurations like that.

Additionally, you could define a x64 build that had some projects target x64 and others target AnyCPU depending on need. Or even a build target that excluded specific projects and included others depending on need.

So in short, the config manager lets you control the inter-process build relations at a level beyond the simplistic debug-all or release-all.

I'd also guess, that 99% of the time you won't need to mess w/the config manager anyway. :-)

WaldenL
A: 

I've found this tool incredibly useful in the following situations :

1- You have a lot of projects in a solution, and you want to build only the project you're currently working on (which takes 10s instead of 2mn)

2- You have to produce on a regular basis different type of builds (debug vs release, x64 vs x86, etc.)

To answer your question regarding differences between debug and release mode, it definitely makes a difference. Typically, VS will compile your code "as is" when building in debug mode, while it will optimize (ie inlining, etc.) things in release mode.

For example, if you build this code :

    public bool Foo(){
    return true; // put a breakpoint here, and move the execution position to the next line
    console.WriteLine("Foo"); 
    return true;
   }

In debug mode, you will be able to do that , not in release mode (because the compiler has detected the code was unreachable, and hasn't build it at all.

Brann
Actually your breakpoint will never be hit in debug mode either because the program will never get there.
demoncodemonkey
whooops ; i edited my post to better explain what I meant
Brann