2

Usually when I debug a SharePoint Web Part, if I have an unhandled Exception the Debugger breaks at the line where the Exception occurred. However, I have a Web Part, that my predecessor made, that goes directly to the OTB Runtime Error page. There is no error handling in the C# code. I looked at the debug options and everything looks right; all options of the form "Break when X" are turned on.

Is there some setting that causes the behavior that I am seeing?

  • I eventually found the error; it was ArrayOutOfBounds. I used the Exceptions menu (ctrl + alt + e) to make VS break on errors. The problem with this is that it is easy to make VS break on every type of error or none; there isn't a setting to select errors that have a high impact on the execution. This is made more annoying because VS clearly knows the difference between non-fatal and fatal errors. I had to hit continue on tons of, basically, warnings to finally arrive at an error that the Debugger could not continue from. Why isn't there a standard Error-List-To-Break-On? – amsackett Mar 9 '16 at 22:10
  • I'm leaving this open for a couple of days in hopes that someone knows how to setup an Error-List-To-Break-On. I hope that it's a setting that I missed. – amsackett Mar 9 '16 at 22:13
0

Usually this happens when your code works right but you feed bad data or otherwise cause something squirrelly to happen in SharePoint proper. Take a look at your ULS logs for this period to see if there's more there than just some random, unnamed exception. Beyond that, it must be happening on the server side so I doubt the other tools available (Fiddler, F12 Dev tools, Firebug, SharePoint's analysis tools) will be much of use, unfortunately.

0

The best I was able to do was use the Exceptions menu (ctrl + alt + e) and checked "Common Language Runtime Exceptions". This option, unfortunately, catches a great number of non-fatal errors that can't be fixed; just hit the Continue button until you get to an error that the debugger will not go past.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.