web.config <compilation> Element

Discussion in 'ASP .Net' started by =?Utf-8?B?Um9i?=, Oct 6, 2005.

  1. 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.
     
    =?Utf-8?B?Um9i?=, Oct 6, 2005
    #1
    1. Advertising

  2. Rob wrote:
    > 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
     
    JIMCO Software, Oct 6, 2005
    #2
    1. Advertising

  3. 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/
    ======================================
    "Rob" <> wrote in message
    news:...
    > 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.
     
    Juan T. Llibre, Oct 6, 2005
    #3
  4. Juan T. Llibre wrote:
    > 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
     
    JIMCO Software, Oct 6, 2005
    #4
  5. I'll stand by :

    > 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/
    ======================================
    "JIMCO Software" <> wrote in message
    news:...
    > Juan T. Llibre wrote:
    >> 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
    >
    >
    >
    >
     
    Juan T. Llibre, Oct 6, 2005
    #5
  6. Juan T. Llibre wrote:
    > I'll stand by :
    >
    >> You should *always* include <compilation debug="false"/>
    >> in your production server's web.config.

    >
    > ;-)
    >


    Sometimes my verbosity switch gets stuck. ;)

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

    FrontPage add-ins for FrontPage 2000 - 2003
     
    JIMCO Software, Oct 6, 2005
    #6
  7. =?Utf-8?B?Um9i?=

    nagarjuna32

    Joined:
    Jul 12, 2008
    Messages:
    1
    We are facing problem with <compilation debug="false"/> in production server. Throwing "Thread abort exception" for long run processes after 10-15 mins.
     
    nagarjuna32, Jul 12, 2008
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Um9iZXJ0?=
    Replies:
    3
    Views:
    6,928
    Steven Cheng[MSFT]
    Nov 15, 2005
  2. RonL
    Replies:
    0
    Views:
    769
  3. MK
    Replies:
    5
    Views:
    22,728
    deftflux
    Jun 27, 2008
  4. CSharpner
    Replies:
    0
    Views:
    1,111
    CSharpner
    Apr 9, 2007
  5. Dan
    Replies:
    4
    Views:
    579
Loading...

Share This Page