Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Downside of using Debug builds for production

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Terry Wahl - 12 Jul 2007 14:20 GMT
We are using smartclients in an intranet environment and are considering
using  distributing debug builds (.exe, .dll, .pdb, ...).  We like the fact
that when an exception occurs we are given a nice stack trace with the line
number of source where the exception occurred.  What are the downsides of
using debug builds in production?
Thanks for your help,
Terry
Paul Hadfield - 13 Jul 2007 07:20 GMT
The biggest downside would be that this indicates there is probably a farily
major flaw in the design of your application, or at the very least in your
exception handling (i.e. none?).  With the correct design you can still
obtain (and log) all this information and your program won't fatally fail!
Other than that, i'd guess the only difference could be one of performance,
debug code is probably not going to be as fast or lean as production
compiled code.

> We are using smartclients in an intranet environment and are considering
> using  distributing debug builds (.exe, .dll, .pdb, ...).  We like the
[quoted text clipped - 5 lines]
> Thanks for your help,
> Terry
Terry Wahl - 13 Jul 2007 13:32 GMT
No design flaw here.  Exceptions are being handled correctly.  We are making
use of Microsoft's Exception Handling application block.  I agree with you
about the performance as a result of the bloated code and additional
assemblies (.pdb's).  Releasing debug results in the stack traces that
containing line numbers (production does not) and also allows me to attach to
the process if I desire to debug the application.
Thanks,
Terry

> The biggest downside would be that this indicates there is probably a farily
> major flaw in the design of your application, or at the very least in your
[quoted text clipped - 13 lines]
> > Thanks for your help,
> > Terry
Patrice - 13 Jul 2007 14:50 GMT
AFAIK debug builds are unoptimized and larger in size.

In my own experience it's not that difficult to find out where it fails even
without line numbers. Make sure to keep your procedures to a minimal size
(good practice anyway). You could also perhaps store some data from your
general layers to help (things like say the name of the last stored proc you
sent to the DB or similar info).

--
Patrice

> No design flaw here.  Exceptions are being handled correctly.  We are
> making
[quoted text clipped - 30 lines]
>> > Thanks for your help,
>> > Terry
Peter Duniho - 13 Jul 2007 15:04 GMT
> No design flaw here.  Exceptions are being handled correctly.  We are  
> making
[quoted text clipped - 5 lines]
> attach to
> the process if I desire to debug the application.

Others have pointed out some typical differences between a "debug" and  
"release" build.  Though one must be careful to keep in mind that they are  
just generalizations.  For example, an "optimized" build could in some  
cases be larger than the "non-optimized" build, depending on what the  
optimization goals are.

That said, it seems to me that you are really only interested in one  
aspect of the "debug" build: the inclusion of symbols (the .pdb file)  
allowing for the stack trace to include line numbers in the exceptions.  
The ability to attach to the process is a red herring.  You can attach the  
debugger to any process; the only question is whether you get useful  
symbol information when you do so.

While I haven't done this in .NET yet, I would be surprised if it's that  
different from non-managed code.  In particular, with non-managed code you  
can still generate a PDB for an optimized build, and you can still debug  
the code using that PDB (as well as do things like use the various debug  
helper DLLs to map code addreses to source code line numbers, which is  
esssentially the behavior you're looking for with respect to the stack  
trace).  Of course, because an optimized build often rearranges code,  
removes code, etc. there is not always a one-to-one correspondence between  
the executing code and your original source code.  But that is likely to  
be an insignificant issue with respect to the goals you're stating.  With  
the correct symbols, you can still debug an optimized build even if you  
may get disoriented once in awhile, and you can still get reasonably  
useful stack trace information.

So, if you are at all concerned about the downside of using a debug build  
for your released version (and frankly, you probably should be if your  
application is even a little bit performance-bound), it would be better to  
go ahead and release an optimized build, but make sure that symbols are  
included so that you can get the debugging information you want.

Pete

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.