Hmmm .. I didn't know it was web based.
See the stack trace does help you still narrow down where the error might
be. Then you know it is an Object reference not set to an instance of an
object kind of error.
Check and see the existence of the object being used at that very point (the
line giving you the error) .. that might throw some ideas.
- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/
Jigar said:
I do not think that code can help me.
I am already getting stack trace which we normally get while running web
applications. i beleave when my webcontrol (dll) is compiled in release mode
i can not get more information then what i am getting. so i need to compile
same application with debug mode, and when i compile same application in
debug mode error disappears.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the exception
can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
myapp.getDrawData() +1371
myapp..ctor(Data Data) +639
mycontrol.Render(HtmlTextWriter output) +223
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
....
..
.
Sahil Malik said:
Jigar,
Look at this article -
http://www.ftponline.com/vsm/2003_11/magazine/features/dollard/
It's got a downloadable code thing that will let you trap the exact stack
trace etc. (if you are not doing that already), that will point you to the
exact line the error is happening at. Maybe that'll help ya a bit !!
- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/
Control throws error when compiled in release mode. but works nicely when
compiled in debug mode.
I have created class library which has several user controls, now one of
the control is throwing null reference error.(object reference not set to
instance of object).
To trap exact place of error I recompiled this dll with debug option ..
to my surprise control works with out error when I compile with debug
option.
I tried switching .net frame work version 1.0 & 1.1 same thing happens
with both.
How I can trap error if I can not get error in debug mode? and what could
be reason for this behavior