VS2008 - Release Build sets linker opt /DEBUG ??
-
Friday, January 28, 2011 2:42 PMHi,In Visual Studio you can have "debug" and "release" configurations. You canswitch between them in the project properties dialog. The default settingswill generally be tailored to each configuration. However, I noticed that inmany of my native C++ projects, the "release" configuration has thefollowing linker options:1. Generate Debug Info : Yes (/DEBUG)2. Generate Program database file : $(targetdir)$(targetname).pdbIs this normal??
- Moved by Larcolais Gong Tuesday, February 01, 2011 8:33 AM (From:Visual Studio Setup and Installation)
All Replies
-
Saturday, January 29, 2011 3:27 PM
Hi,
I have a similar problem.
I am currently working on small VB WPF program for .NET Framework 3.5 SP1,
and even when Properties > Compile has the settings
. Configuration: Release
. Build output path: bin\Release\
. Advanced compile options > General debug info: None
and Properties > Debug has the setting
. Configuration: Release
VS always builds only a debug .exe in \bin\Debug. In VS 2005 there was the option to compile a Release version. Has this feature been dropped in VS 2008?
Is this a VS bug, or are there settings I can modify to obtain the expected behaviour?
Visual Studio 2008 Pro, Version 9.0.30729.1 SP on Windows XP SP3
JPL
-
Sunday, January 30, 2011 7:01 PM
The problem was that settings in Build > Configuration Manager... (which I did not recognise at all - I cannot have looked there since the day VS was installed) were constraining those within the project properties.
Gerry,
Apologies for confusing your thread. I thought I had a similar problem and the additional notes would help in solving your problem. As it turned out, this proved incorrect.
JPL
-
Monday, January 31, 2011 6:12 AM
Hi Gerry,
Any update? Has your question been resolved?
Best Regards,
Larcolais
Larcolais Gong[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Monday, January 31, 2011 2:32 PM
-
Monday, January 31, 2011 2:37 PM"JPL5780" wrote in messagenews:982f981f-5acc-4e98-a390-5847215e2b84@communitybridge.codeplex.com...> The problem was that settings in Build > Configuration Manager... (which I> did not recognise at all - I cannot have looked there since the day VS was> installed) were constraining those within the project properties.Yes, you can change the project settings for debug/release, but the"Configuration Manager" determines the "Active Configuration" and "ActivePlatform".
-
Tuesday, February 01, 2011 8:31 PM
-
Wednesday, February 02, 2011 2:31 AM
Yes this is normal. By default, even in "Release" configuration, the debug info file (.pdb) is created.
This is just for extremely unlikely case that a released app crashes and someone needs to debug it. But this never happens to Real Programmers ;) so these are free to disable /DEBUG.
--pa
- Proposed As Answer by Yi Feng LiModerator Friday, February 04, 2011 3:25 AM
- Marked As Answer by Yi Feng LiModerator Friday, February 18, 2011 3:47 AM
-
Friday, February 04, 2011 3:28 AMModerator
Hello,
I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?
YI
Yi Feng Li [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Tuesday, February 08, 2011 11:06 PMHello Yi,I did not find helpful any of the answers so far.There are two build profiles in Visual Studio - "Debug" and "Release"The linker options in the "Release" configuration are set to includedebugging information in the COFF by default - this seems wrong to me.The "Release" configuration should mean it's ready for commercial release.If a programmer want's to create a "Release" build with "special" debugoptions, because they have not tested their program correctly, thensurely it's the programmer's responsibility to create a specialconfiguration called "ReleaseD"?Thanks for the help with this.Yi Feng Li wrote:> Hello,>> I am writing to check the status of the issue on your side. Would you mind> letting us know the result of the suggestions?>> YI>> --------------------------------------------------------------------------------> Yi Feng Li [MSFT]> MSDN Community Support | Feedback to us<mailto:msdnmg@microsoft.com>> Get or Request Code Sample from Microsoft<http://1code.codeplex.com>> Please remember to mark the replies as answers if they help and unmark them if> they provide no help.>
-
Thursday, February 10, 2011 8:09 AMModerator
Hi Gerry,
It is not possible to create an .exe or .dll that contains debug information. Debug information is always placed in a .pdb file. Therefore, either debug build or release build places the debug information in the corresponding .pdb file. The major difference of output build between debug and release is optimization. And debug build using Program Database for Edit & Continue (/ZI) for generate pdb file which is used for Visual Studio Debugger but release build only use Program Database (/Zi).
Generate debug information for release build is useful sometime. For example, your customer may send you the dump of a crash of your released application; you can use such pdb file to get more detail information for the dump. Of cause, as Pavel said, if you don’t want to generate such pdb files, you can just feel free to turn off the switch.
Hope the explanation helps.
Regards,
Yi
Yi Feng Li [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

- Marked As Answer by Yi Feng LiModerator Friday, February 18, 2011 3:47 AM
-
Monday, February 14, 2011 2:34 AMModerator
Hello,
Would you mind letting me know the result of the suggestions? If you need further assistance, feel free to let me know. I will be more than happy to be of assistance.
YI
Yi Feng Li [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


