My debugging method of choice is the ASP.Net trace feature. In web config, I set the trace options:
<trace enabled=”true” pageOutput=”true” localOnly=”true” />
This will dump a bunch of information at the bottom of the page. (WARNING: Do not do this on a publicly accessible machine. It will compromise security.)
In my web part, I include a call to Context.Trace.Write at the beginning of each routine. In the catch blocks, I call Context.Trace.Warn(ex.ToString). This puts the entire exception into the trace output. Plus, it avoids the WSS error page (“The [Name] Web Part appears to be causing a problem.“)