473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Debug vs. Release Build

It is my understanding - and please correct me if I'm wrong - that when
building a project in debug mode, I can deploy the .pdb file along with the
..exe and thereby have access to the specific line number of code that throws
an exception. Specifically, I can have an error logging routine that,
amongst other things parses the call stack and tells me the specific line of
code that choked.

It is also my understanding that if building in Release mode that I won't
get the .pdb file and/or have programmatic knowledge of the specific line of
code that threw an exception.

If the above is true, then that would seem to be a big advantage of building
in debug mode and putting that into production - rather than building in
release mode.

What do you think?

I'm looking for reasons to build in "Release mode" but can't seem to get
past the fact that I lose the knowledge of which line of code choked.

I would appreciate your perspective on this... and what is different about
building as Release vs. Debug.
Oct 5 '07 #1
3 15486
Never ever put debug builds into production. Your build process should emit
release builds, so all system testing is on production code.

You CAN create pdbs for release builds; in VS 2005, go to project
properties, Build, set the Configuration to Release, click Advanced, and set
Debug Info to pdb-only (not the default). Microsoft recommend not using full
info for release builds, as this impacts size, performance and code quality,
whereas pdb-only does not.

However you do not need a pdb to find out where an exception occurred - just
log Exception.ToString(), which includes the stack trace.

The pdb is useful if you want to debug the production system, e.g., attach a
debugger to the running process (requires full info), or debug a crash dump.
You can do this using windbg, part of the Microsoft Debugging Tools for
Windows.

"Bob Johnson" wrote:
It is my understanding - and please correct me if I'm wrong - that when
building a project in debug mode, I can deploy the .pdb file along with the
..exe and thereby have access to the specific line number of code that throws
an exception. Specifically, I can have an error logging routine that,
amongst other things parses the call stack and tells me the specific line of
code that choked.

It is also my understanding that if building in Release mode that I won't
get the .pdb file and/or have programmatic knowledge of the specific line of
code that threw an exception.

If the above is true, then that would seem to be a big advantage of building
in debug mode and putting that into production - rather than building in
release mode.

What do you think?

I'm looking for reasons to build in "Release mode" but can't seem to get
past the fact that I lose the knowledge of which line of code choked.

I would appreciate your perspective on this... and what is different about
building as Release vs. Debug.
Oct 5 '07 #2
"Adrian" <Ad****@discussions.microsoft.comwrote in message
news:BD**********************************@microsof t.com...
However you do not need a pdb to find out where an exception occurred -
just
log Exception.ToString(), which includes the stack trace.
But if you do deploy the pdb file, you will get much more detailed
information about the exception, even down to the number of the line which
threw it...

--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 5 '07 #3
We've been deploying Release builds with PDB files for years now. It's just
an option in Visual Studio, and it's also easily set using MSBuild or NAnt.

Without the ability to do this, we would be screwed.

--
Chris Mullins

"Bob Johnson" <A@B.comwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
It is my understanding - and please correct me if I'm wrong - that when
building a project in debug mode, I can deploy the .pdb file along with
the .exe and thereby have access to the specific line number of code that
throws an exception. Specifically, I can have an error logging routine
that, amongst other things parses the call stack and tells me the specific
line of code that choked.

It is also my understanding that if building in Release mode that I won't
get the .pdb file and/or have programmatic knowledge of the specific line
of code that threw an exception.

If the above is true, then that would seem to be a big advantage of
building in debug mode and putting that into production - rather than
building in release mode.

What do you think?

I'm looking for reasons to build in "Release mode" but can't seem to get
past the fact that I lose the knowledge of which line of code choked.

I would appreciate your perspective on this... and what is different about
building as Release vs. Debug.


Oct 5 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bnc mag | last post by:
Hello, Visual Studio 6 allows users to specify seperate post-build steps to perform on Debug and Release builds. I am trying to do the same thing in C#.NET 2003, but it appears as though I only...
2
by: babyx | last post by:
The release build class library can only work with msvcr71d.dll and msvcp71d.dll exist. How to make this class library work on any machine without using the debug dlls? What are the project...
5
by: David++ | last post by:
Hi there, I have built a DLL in Visual C++ 6. When I build the DLL it builds fine for the debug version of the DLL (and this DLL works fine), however, I seem unable to build a Release version of...
7
by: Tom | last post by:
How can I make code not execute for a debug build, but do execute for a production build? I have code which prompts for an account and password when the program starts up. It is a pain to have to...
6
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++...
3
by: Bob Johnson | last post by:
It is my understanding - and please correct me if I'm wrong - that when building a project in debug mode, I can deploy the .pdb file along with the ..exe and thereby have access to the specific...
6
by: =?Utf-8?B?SHVnaA==?= | last post by:
Hi there We are trying to build a C sharp solution in Visual Studio 2005 Professional. We have a number of other assemblies, that do not form part of the solution. Assemblies that do form...
5
by: Andy B | last post by:
How do you tell vs2005 to keep debug info out of your release builds? When I build a release and a debug version, there seems to be no difference in them at all...The release builds still have the...
3
by: =?Utf-8?B?bG10dGFn?= | last post by:
We have developed a number of different applications (ASP.NET web site, Windows services, DLLs, Windows forms, etc.) in C# 2.0. We have developed and unit tested all these applications/components...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.