Setting "debug=false" causes error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Whiplash

    Setting "debug=false" causes error

    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

    #2
    Re: Setting "debug=fal se" causes error

    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

    [color=blue]
    > 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
    >[/color]


    Comment

    • Whiplash

      #3
      Re: Setting "debug=fal se" causes error

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

      D

      Comment

      • Scott Allen

        #4
        Re: Setting "debug=fal se" causes error

        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

        [color=blue]
        > Scott, went back and checked.... no Debug.Assert statements, no
        > conditional directives, no Trace used... I'm really stumped.
        >
        > D
        >[/color]


        Comment

        Working...