RE: best debug / perfmon options to drilldown to find error
- From: "Mike Goatly" <unklemunkle@xxxxxxxxxxxxx>
- Date: Tue, 5 Apr 2005 09:29:02 -0700
Hi,
The first thing I'd do is set the CLR to break into code whenever an
exception is thrown - that way you'll see exactly what's throwing the error
(unless it's from someone elses dll - but you should still be able to see
what's causing it in the call stack - I'll explain that in a mo.)
To set the CLR to "break on all errors" you need to go to the Exceptions
window (Debug->Exceptions or Ctrl-Alt-E) , click on the "Common Language
Runtime Exceptions" node in the exceptions list, and change the "When an
exception is thrown" option to "Break into the debugger"
Now run the code again...
When you get the exception, have a look at the call-stack window. (if it's
not visible you can get at it from Debug->Windows->Call Stack) At the top of
the list is the method the exception was raised from. That might provide
some insight into what's going wrong...
Failing that, if you could post the callstack here, someone here might be
able to help a bit more.
Cheers,
Mike
"chris yoker via DotNetMonster.com" wrote:
> hiya,
> I have winforms app that contains buttons.
> Any time that I click on any of the buttons, I get an error:
>
> <error>
> An unhandled exception of type 'System.NullReferenceException' occurred in
> system.windows.forms.dll
> Additional information: Object reference not set to an instance of an
> object.
> <\error>
>
> This error occurs BEFORE, the "Button_click" event fires.
>
> However, despite the fact that I set breakpoints at:
> 1) "btnClose_Click" event
> 2) "frmProduct_Closed" event
> 3) "frmProduct_Closing" event
>
> The app goes straight into a 'System.NullReferenceException' error.The
> breakpoints do not even reach the "btnClose_Click" event.I know for a fact
> that debugging works on this app.
> I am using vis studio 2003 + perfmon
> Also, I have added a ".net CLR memory" log to perfmon.
>
> Can anyone suggest which "debug" options will help me drilldown and find
> the error, eg callStack, threads?..ATM, I am only familiar with "watch" and
> "breakpoints"
>
> To be honest, I am dancing round in the dark.
>
> many thanks,
> yogi
>
> --
> Message posted via http://www.dotnetmonster.com
>
.
- Follow-Ups:
- RE: best debug / perfmon options to drilldown to find error
- From: chris yoker via DotNetMonster.com
- RE: best debug / perfmon options to drilldown to find error
- References:
- best debug / perfmon options to drilldown to find error
- From: chris yoker via DotNetMonster.com
- best debug / perfmon options to drilldown to find error
- Prev by Date: RE: need to create shared folder
- Next by Date: System.Diagnostics.Process doesn't work when performance counters are disabled
- Previous by thread: RE: best debug / perfmon options to drilldown to find error
- Next by thread: RE: best debug / perfmon options to drilldown to find error
- Index(es):
Relevant Pages
|