PC Review


Reply
Thread Tools Rate Thread

Debug vs. Release Build

 
 
Bob Johnson
Guest
Posts: n/a
 
      5th Oct 2007
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.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWRyaWFu?=
Guest
Posts: n/a
 
      5th Oct 2007
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.
>
>
>

 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      5th Oct 2007
"Adrian" <(E-Mail Removed)> wrote in message
news:BDC5B31D-63E4-41ED-A9CE-(E-Mail Removed)...

> 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

 
Reply With Quote
 
Chris Mullins [MVP - C#]
Guest
Posts: n/a
 
      5th Oct 2007
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" <(E-Mail Removed)> wrote in message
news:%23vCbI%(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debug Build fails, Release Build OK - VC++ 6.0 to VS2005 port =?Utf-8?B?bm1yY2FybA==?= Microsoft VC .NET 4 24th Oct 2006 12:04 AM
Re: crash in release build, but it works on debug build kevinding@tom.com Microsoft VC .NET 0 17th Jul 2006 07:41 AM
Debug vs Release Build =?Utf-8?B?SmFtZXM=?= Microsoft Dot NET Compact Framework 1 25th May 2005 05:20 AM
LNK2022 error in Release build; not in Debug build Bill Davidson Microsoft VC .NET 0 29th Sep 2004 01:17 AM
Debug Build works perfectly; Release Build fails silently! Peter R. Fletcher Microsoft Dot NET Framework 11 13th Jul 2004 07:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:44 PM.