Note that there are some explanatory texts on larger screens.

plurals
  1. POSP 2007 - Webpart cannot be displayed
    primarykey
    data
    text
    <p>Error: "A Webpart on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe"</p> <p>Trying to find the details of this error in source-code but not quite sure where the exact problem is located.</p> <p>refer to <a href="https://stackoverflow.com/questions/7878798/sharepoint-2k7-custom-webpart-not-loading/7882656#7882656">This Thread</a> for previous fixes performed.</p> <p>Any pointers on a good location to start?</p> <p><strong>DLL:</strong> TCBOE.ChartPart.dll</p> <p><strong>Namespace:</strong> TCBOE.Chartpart</p> <p><strong>FeatureReceiver.vb</strong></p> <pre><code>Private Shared Sub AddOrRemoveChartHandlerToWebConfig(ByVal web As SPWebApplication, ByVal remove As Boolean) Dim asm As String = String.Format(CultureInfo.InvariantCulture, _ "System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version={0}, Culture=neutral, PublicKeyToken={1}", _ New Object() {"3.5.0.0", "31bf3856ad364e35"}) Dim modif As New SPWebConfigModification("add[@path='ChartImg.axd']", _ "configuration/system.web/httpHandlers") modif.Owner = "TCBOE.ChartPart" modif.Sequence = 0 modif.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode modif.Value = String.Format(CultureInfo.InvariantCulture, _ "&lt;add verb=""{0}"" path=""{1}"" type=""{2}"" validate=""{3}"" /&gt;", _ New Object() {"GET,HEAD,POST", "ChartImg.axd", asm, "false"}) If (remove) Then web.WebConfigModifications.Remove(modif) Else web.WebConfigModifications.Add(modif) End If End Sub Private Shared Sub AddOrRemoveChartSettingsToWebConfig(ByVal web As SPWebApplication, ByVal remove As Boolean) Dim appSettings As New SPWebConfigModification("appSettings", "configuration") appSettings.Owner = "TCBOE.ChartPart" appSettings.Sequence = 0 web.WebConfigModifications.Add(appSettings) Dim keyVal As String = String.Format(CultureInfo.InvariantCulture, _ "storage={0};timeout={1};", _ New Object() {"memory", "20"}) Dim modif As New SPWebConfigModification("add[@key='ChartImageHandler']", "configuration/appSettings") modif.Owner = "TCBOE.ChartPart" modif.Sequence = 1 modif.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode modif.Value = String.Format(CultureInfo.InvariantCulture, _ "&lt;add key=""{0}"" value=""{1}"" /&gt;", _ New Object() {"ChartImageHandler", keyVal}) If remove Then web.WebConfigModifications.Remove(modif) Else web.WebConfigModifications.Add(modif) End If End Sub &lt;SharePointPermission(System.Security.Permissions.SecurityAction.Demand, ObjectModel:=True)&gt; _ Public Overrides Sub FeatureActivated(ByVal properties As Microsoft.SharePoint.SPFeatureReceiverProperties) Dim site As SPSite = TryCast(properties.Feature.Parent, SPSite) Dim web As SPWebApplication = site.WebApplication AddOrRemoveChartSettingsToWebConfig(web, False) AddOrRemoveChartHandlerToWebConfig(web, False) web.Farm.Services.GetValue(Of SPWebService)().ApplyWebConfigModifications() web.Update() End Sub &lt;SharePointPermission(System.Security.Permissions.SecurityAction.Demand, ObjectModel:=True)&gt; _ Public Overrides Sub FeatureDeactivating(ByVal properties As Microsoft.SharePoint.SPFeatureReceiverProperties) Dim site As SPSite = TryCast(properties.Feature.Parent, SPSite) Dim web As SPWebApplication = site.WebApplication AddOrRemoveChartSettingsToWebConfig(web, True) AddOrRemoveChartHandlerToWebConfig(web, True) web.Farm.Services.GetValue(Of SPWebService)().ApplyWebConfigModifications() web.Update() End Sub </code></pre> <hr> <h2>Added: 10/26/2011 @ 11:36am</h2> <h2>Manifest.xml</h2> <p>(As created by WSPBuilder)</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;!-- Solution created by WSPBuilder. 10/26/2011 8:19:40 AM --&gt; &lt;Solution SolutionId="ee03c5c2-c9bd-4cfe-ac16-225f8e28072b" xmlns="http://schemas.microsoft.com/sharepoint/"&gt; &lt;Assemblies&gt; &lt;Assembly Location="cablib.dll" DeploymentTarget="GlobalAssemblyCache" /&gt; &lt;Assembly Location="TCBOE.ChartPart.dll" DeploymentTarget="GlobalAssemblyCache"&gt; &lt;SafeControls&gt; &lt;SafeControl Assembly="TCBOE.ChartPart, Version=3.5.1.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" Namespace="TCBOE.ChartPart" TypeName="*" Safe="True" /&gt; &lt;/SafeControls&gt; &lt;/Assembly&gt; &lt;/Assemblies&gt; &lt;TemplateFiles&gt; &lt;TemplateFile Location="IMAGES\ChartPartWP\oscillator_16.gif" /&gt; &lt;TemplateFile Location="IMAGES\ChartPartWP\oscillator_32.gif" /&gt; &lt;/TemplateFiles&gt; &lt;FeatureManifests&gt; &lt;FeatureManifest Location="ChartPartWP\feature.xml" /&gt; &lt;/FeatureManifests&gt; &lt;/Solution&gt; </code></pre> <p>Are there any situations where a CAS policy would restrict a local-machine user account (used to run services) would cause this kind of behaviour?</p> <h2>Edit 11/3/2011:</h2> <p>Ok finally got a "Great Practices" install and it is stable and working. Got the original control i am customizing to load and working as it should.</p> <p>Went to go "install" my edited control and received this error response when trying to deploy the solution:</p> <pre><code>Feature '47d62f5e-b0e0-4f93-bcd1-081ca794527c' could not be installed because the loading of event receiver assembly "TCBOE.ChartPart, Verstion=3.5.1.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" failed: System.IO.FileNotFoundException: Could not load file or assembly 'TCBOE.ChartPart, Culture=neutral, PublicKeyToken=9f4da00116c38ec5' or one of its dependencies. The system cannot find the file specified. File name: 'TCBOE.ChartPart, Culture=neutral, PublicKeyToken=9f4da00116c38ec5' at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload