views:

359

answers:

3

I understand that debug=true is a bad thing on any production server.

I am currently using some dll's that are from a third party and were compiled in debug mode and wanted to know - What happens to a DLL in debug mode inside a web application with debug=false?

+2  A: 

In C# / .NET (unlike C++ DLLs) it is generally not an issue. Debug and Release are near identical and there are no memory-management issues (as there would be with C++ DLLs).

The following is from jaybaz's blog:

There are 3 things people typically identify as the difference between debug & release. You need to decide which one you’re interested in:

“DEBUG” preprocessor flag. Can be set on the whole assembly/netmodule with ‘csc /define’, or on a whole file with #define.

Debugging information (pdb). Set with ‘csc /debug[+|-]’. It doesn’t affect codegen, so it’s really not very interesting.

Optimization. Set with ‘csc /optimize[+|-]’. In managed code, the JITter in the runtime does nearly all the optimization. The difference in generated IL from this flag is pretty small. The Whidbey C# compiler has more a difference on this flag than previous versions, but it’s still not much.

Ray Hayes
A: 

AFAIK if compiled in debug mode compilers does not optimizes the binary data so making it easy for debugger. It might result in bad performance in cases. Also compiler adds extra data to builds for debugger.

I assume you are talking about ASP.Net website and about dll compiled in debug mode vs. release mode.

Ratnesh Maurya
In .NET most optimizations are left to the JIT however there are a few optimizations (typically for size) that are not made as you say to make it easier for debugging.
AnthonyWJones
+1  A: 

The debug attribute of the system.web/compilation configuration element has no effect on the code of compiled DLLs.

It only affects code that's compiled dynamically, and has some other effects on the runtime (e.g. the executionTimeout element of the system.web/httpRuntime configuration element is ignored if debug=true).

Joe