Specifically or generally? In general, my understanding is that debug code
has the .PDB file generated alongside the .DLL/.EXE (for symbol names and
such that normally don't make it into the metadata), and that the CIL
generated is slightly less optimized. I think the JIT also takes a
less-optimized path when JITting debug code, being more conservative with
local references that are semantically garbage (instead of waiting until the
end of the scope block to release them, it releases them early once it
determines they're not used again). What you might do, to see the
differences in the assemblies themselves, is take the debug version and
release version, do an ildasm /diasm /out:foo.il and diff the two to see
what, if any, CIL is different. That might help you get started if the
problem lies rooted in CIL, but won't help at all if the problem is rooted
in the JITter's behavior.

What about attaching to the service with WinDbg and SOS to trap the crash
and have a look? Robbins has some good info on WinDbg and SOS in his
"Debugging .NET and Windows Applications" book, if you've not done this
before.

Ted Neward
Author, Presenter, Consultant
Java, .NET, XML services
http://blogs.tedneward.com

> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Mark Marlow
> Sent: Thursday, December 15, 2005 12:45 PM
> To: [email protected]
> Subject: [ADVANCED-DOTNET] What is the difference between Release and
> Debug code?
>
> Hi All,
>
>
>
> I have a .Net (version 1.1) service which runs on a 2 way Xeon (Windows
> NT2K3 SP1) box.  The service consumes data and updates some SQL Server
> tables.  All code is executed within try/catch/finally blocks.  All catch
> blocks write to an application log file using log4net.
>
>
>
> The service crashes unexpectedly (about 1/3 the way through its job) when
> compiled as release code, and runs without error when compiled as debug
> code.   There is no evidence of an error in the application log files
> which
> do emit informational strings as the service progresses.  Curiously, the
> release and debug version run fine on my development system (XP Pro) and
> QA
> server (2 way Pentium  w/ NT2K3SP1)
>
>
>
> What is the difference between debug code and release code?  I am hoping
> that knowing the difference will help me pin point the problem.  Any
> pointers or tips on narrowing this problem down would be appreciated.
>
>
>
>
>
> Thanks for your help,
>
> Mark
>
>
> ===================================
> This list is hosted by DevelopMentor.  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to