title: How to identify an unsafe web part / control
body: <p>I get an error when trying to edit a page in a SharePoint site. Using WinDbg I see that actual error is:</p>
  
  <blockquote>
    <p>Microsoft.SharePoint.ApplicationRuntime.SafeControls+UnsafeControlException</p>
  </blockquote>
  
  <p>This looks to me like I have a control on the page which is not included in the &lt;SafeControls&gt; 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.</p>
  
  <p>Digging a little deeper (and using <a href="http://www.stevestechspot.com/SOSEXV2NowAvailable.aspx" rel="nofollow noreferrer">Sosex.dll</a>) I got the following data from the callstack which lead up to the error:</p>
  
  <pre><code>0:013&gt; !mframe 03
  0:013&gt; !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)
  </code></pre>
  
  <p>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?</p>