469,612 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

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

Nov 19 '05 #1
3 1459
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

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

D

Nov 19 '05 #3
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

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jeremy S. | last post: by
5 posts views Thread by Mr Newbie | last post: by
1 post views Thread by Alexander Walker | last post: by
7 posts views Thread by news.microsoft.com | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.