Another method to debug a web part

on August 11, 2006

Sometimes, I use the CallStack from the web.config. You set it this way:

Code:

<SharePoint>
<SafeMode MaxControls="50" CallStack="true" />;

It will otuput the callstack on the screen. And provides you with more info to find the error:

Server Error in ‘/’ Application.
——————————————————————————–

The webpartlibrary.HeadLines, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f972e2dbee89af5f assembly specified in a Register directive of this page could not be found.
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: Microsoft.SharePoint.WebPartPages.WebPartPageUserException: The webpartlibrary.HeadLines, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f972e2dbee89af5f assembly specified in a Register directive of this page could not be found.

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:


[WebPartPageUserException: The webpartlibrary.HeadLines, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f972e2dbee89af5f assembly specified in a Register directive of this page could not be found.]
Microsoft.SharePoint.ad.a(i A_0) +514
Microsoft.SharePoint.g.c() +13
Microsoft.SharePoint.ad.c(Int32 A_0) +66
Microsoft.SharePoint.ad.d(Int32 A_0) +35
Microsoft.SharePoint.ad.a(Boolean A_0) +190
Microsoft.SharePoint.g.a() +82
Microsoft.SharePoint.SPWeb.a(Uri A_0, bn A_1, HttpContext A_2, Boolean A_3, Boolean A_4, Int64& A_5, SPWebPartCollection& A_6) +190
Microsoft.SharePoint.ApplicationRuntime.SharePointHandler.SPProcessRequest(HttpContext context) +350

[ApplicationException: Exception of type System.ApplicationException was thrown.]
Microsoft.SharePoint.ApplicationRuntime.SharePointHandler.SPProcessRequest(HttpContext context) +1065
Microsoft.SharePoint.ApplicationRuntime.SharePointHandler.SPProcessRequest(HttpContext context) +0
Microsoft.SharePoint.ApplicationRuntime.SharePointHandler.ProcessRequest(HttpContext context) +21
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87


But do not forget that you did this modification because if you ever encounter a problem that request you to remove the webbart from the page, you do not see anymore the link to the interface, as it is when the CallStach is set to False:

HeadLines, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f972e2dbee89af5f assembly specified in a Register directive of this page could not be found.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily disable Web Parts or remove personal settings. For more information, contact your site administrator.

Ciao

ShareThis