Setting "debug=false" causes error

W

Whiplash

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
 
S

Scott Allen

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.
 
W

Whiplash

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

D
 
S

Scott Allen

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".
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top