web.config <compilation> Element

G

Guest

By default, the web.config file of an ASP.NET application contains the
following debug attribute for the compilation element:

<compilation debug="true"/>

My question is this: When doing the the final build, the compile of the
application is done in "Release" mode. The .dll file is created without a
..pdb file. Is it still necessary to change the debug attribute to "false"
during the final build when compiling in "Release" mode appears to override
debug="true" anyway?

Thank you for any help in advance.
 
J

JIMCO Software

Rob said:
My question is this: When doing the the final build, the compile of
the application is done in "Release" mode. The .dll file is created
without a .pdb file. Is it still necessary to change the debug
attribute to "false" during the final build when compiling in
"Release" mode appears to override debug="true" anyway?

The two aren't really the same thing. You should ALWAYS set debug = false
in the web.config in a production application.

ASP.NET code explicitly disables batch compilation when debug = true. That
means that every page that gets hit creates its own dynamic assembly. These
assemblies get scattered all over the address space and fragment memory.
The result is that you dramatically increase the probability of an OOM
exception. There are also other drawbacks such as the batch timeout value
being ignored which can cause other problems down the chain.

It's a VERY bad idea to have debug=true in a production app.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003
 
J

Juan T. Llibre

Using <compilation debug="false"/> will, at least,
stop ASP.NET from *trying* to find debug symbols if an error occurs.

Whether VS.NET compiles .pdb files, or not, is not the critical point.

The issue is whether ASP.NET attempts to find debug symbols,
or not, when the application is running on your production server.;

You should *always* include <compilation debug="false"/>
in your production server's web.config.




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 
J

JIMCO Software

Juan said:
Using <compilation debug="false"/> will, at least,
stop ASP.NET from *trying* to find debug symbols if an error occurs.

Whether VS.NET compiles .pdb files, or not, is not the critical point.

The issue is whether ASP.NET attempts to find debug symbols,
or not, when the application is running on your production server.;

You should *always* include <compilation debug="false"/>
in your production server's web.config.

ASP.NET (or more accurately, the CLR) doesn't use symbols in this way.
Stack traces and method name information are obtained via tokens. Symbols
are not necessary. Having debug == true just gives you a single assembly
for each page which is necessary in order to debug it.

Symbols are still needed if you want line numbers or source file names (or
source code debugging.)

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top