Setting "debug=false" causes error

Discussion in 'ASP .Net' started by Whiplash, Jan 21, 2005.

  1. Whiplash

    Whiplash Guest

    I've got a web app that has the debug parameter in the web.config file
    set to true. Everything works great. However, I want to set debug to
    false before putting the app into production. When I do so, I get an
    error that states; "Object reference not set to an instance of an
    object". It also does not have any more information and tells me to set
    debug to true to see more info. But of course, when I set debug to
    true, the app works fine!

    So, my question is, what could be causing an error to appear only when
    debug is set to false? Thanks.

    Dana
     
    Whiplash, Jan 21, 2005
    #1
    1. Advertising

  2. Whiplash

    Scott Allen Guest

    Do you use Debug.Assert statements?
    Do you have any code inside of a conditional directive (#if) that only executes
    during debug?

    It sounds as if the code paths are different for debug and release, and these
    are two scenarios I can think of off the top of my head that can cause the
    problem.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    > I've got a web app that has the debug parameter in the web.config file
    > set to true. Everything works great. However, I want to set debug to
    > false before putting the app into production. When I do so, I get an
    > error that states; "Object reference not set to an instance of an
    > object". It also does not have any more information and tells me to
    > set debug to true to see more info. But of course, when I set debug to
    > true, the app works fine!
    >
    > So, my question is, what could be causing an error to appear only when
    > debug is set to false? Thanks.
    >
    > Dana
    >
     
    Scott Allen, Jan 21, 2005
    #2
    1. Advertising

  3. Whiplash

    Whiplash Guest

    Scott, went back and checked.... no Debug.Assert statements, no
    conditional directives, no Trace used... I'm really stumped.

    D
     
    Whiplash, Jan 21, 2005
    #3
  4. Whiplash

    Scott Allen Guest

    I think the next step would be to some sort of stack trace to see where the
    exception comes from. If you build and deploy the PDB files you should get
    more info:

    Project -> Properties -> Configuration Properties -> Build -> Outputs ->
    set Generate Debugging Information to "true".

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    > Scott, went back and checked.... no Debug.Assert statements, no
    > conditional directives, no Trace used... I'm really stumped.
    >
    > D
    >
     
    Scott Allen, Jan 21, 2005
    #4
    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. Xavier Osa
    Replies:
    0
    Views:
    657
    Xavier Osa
    Jan 9, 2004
  2. Jeremy S.
    Replies:
    2
    Views:
    6,220
    Jeremy S.
    Jan 19, 2005
  3. André
    Replies:
    3
    Views:
    1,641
  4. Bishop
    Replies:
    1
    Views:
    819
    Bishop
    Feb 24, 2007
  5. wcchan

    WebService timeout after setting debug="false"

    wcchan, Jan 7, 2005, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    378
    Sherif ElMetainy
    Jan 10, 2005
Loading...

Share This Page