I get an error when trying to edit a page in a SharePoint site. Using WinDbg I see that actual error is:
Microsoft.SharePoint.ApplicationRuntime.SafeControls+UnsafeControlException
This looks to me like I have a control on the page which is not included in the <SafeControls> section of web.config. I've had a look at the aspx file for the page, but I can't see any controls on there which don't have a reference in web.config.
Digging a little deeper (and using Sosex.dll) I got the following data from the callstack which lead up to the error:
0:013> !mframe 03
0:013> !mdv
Frame 0x3: (Microsoft.SharePoint.ApplicationRuntime.SafeControls.GetTypeFromGuid(System.Guid)):
[A0]:this:0xc00c03e8 (Microsoft.SharePoint.ApplicationRuntime.SafeControls)
[A1]:guid:{ef2d8253-a451-56da-be1d-5f32d5227173} VALTYPE (MT=0000064278430ea8, ADDR=000000000308caa0) (System.Guid)
[L0]:null (System.Type)
[L1]:0x633c50 (System.String) STRVAL=The type could not be found or it is not registered as safe.
[L2]:null (System.Type)
So it looks like I've found the GUID of the control ([A1]) which is causing the problem. Howver, I don't know of a way to find which control this GUID is referencing. There must be a table somewhere in SQL Server whih stores this information? I've already tried dbo.WebParts, selecting against tp_ID with the GUID, but it found nothing. I guess I'm missing something?
To manipulate Web parts programmatically, you can use SPLimitedWebPartManager
See this article to find the idea of how you would remove or locate webpart from page.
With debugger it should be fairly easy to list all those webparts and just see coressponding DisplayTitle for your particular ID.