Debugging Web Parts in Visual Studio

Malformed Web Parts or other Web Part run-time anomalies that are not caught can cause the Web page to fail to load. It's comforting to know that the powerful Visual Studio debugger is available to developers in much the same way as it is for .NET applications. Web Parts debugging is dependent on having a working ASP.NET debugger, so you need to make sure that you can at least set and hit a breakpoint in a regular ASP.NET application.

Consider Figure 3-13. This page is produced because an ill-behaved Web Part could not be loaded.

In most cases, SharePoint exception handling code will catch the error and display the error page. You can use the link on the error page to find the Web Part and close it. (See Figure 3-14 ...

Get Programming Excel® Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.