views:

119

answers:

2

I have a solution in Visual studio containing a winform project(WinProj) and a deployment project for WinProj.

I added to the deployment project the primary output from WinProj. Does it be compiled in Debug or Release mode?

I am asking because in the WinProj code I have conditional precompiler statements

#if DEBUG
    throw;
#endif

will or not be considered this code in the setup project?

By default I don't switch the mode when building the setup project(remains in Debug). So should I?

+2  A: 

This will depend whether you compile your deployment and setup projects in Debug or Release modes.

Darin Dimitrov
what could be sense in a setup project compiled in debug mode? By default I don't switch the mode when building the setup project(remains in Debug). Perhaps I should do it, however...
serhio
I would strongly recommend you compiling in Release mode when shipping your application. For example if you have a continuous integration server performing builds it could be setup for Release mode, while on developer machines you could stay in Debug mode.
Darin Dimitrov
A: 

Actually, I am not sure if I understand the question. Setup projects sould be created with release-built binaries. Inner IL is more efficient when compiled in release mode. You may take a look with ildasm, difference in il code is huge.

Daniel Dolz
"Setup projects should be created with release-built binaries." Yes, but apparently there is a "debug possibility" too(?!)... see Darin Dimitrov answer.
serhio