1

I have been stuck on this error and am unable to solve it since the past few days. I have googled all I could, but none of the solutions seem to work for me. I'll go through all the steps I've done and hopefully, someone might be able to catch a mistake. Also, I've been developing with SharePoint for quite a while now, but still a beginner in some parts.

I have created my site in my SharePoint and created a new Site Collection for it. I deployed my web part with the following command in powershell:

Update-SPSolution -Identity xxxxx.wsp -GACDeployment -LiteralPath "C:\Users\username\Desktop\xxxxx.wsp"

I then go to my created my site and add the web part. Which alerts me with the following message.

I tried many solutions including,

  1. I checked if my Web part is declared as Safe in the web.config or my root site. It looks like this:

<SafeControl Assembly="xxxxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4a87d6fcb45f5672" Namespace="xxxxx.xxx" TypeName="*" Safe="True" SafeAgainstScript="False" />

  1. My class name SharePointProject1.WebPartName is declared as public.
  2. I've deployed the web part to the GAC by using -GACDeployment
  3. The namespace name is same as it is defined in my project.

I also checked my Application Logs in the Event Viewer, but there are no errors mentioned there as well.

After all this, I have a feeling maybe it might be a problem with my User Profile Service creation, though I'm not very familiar with this side of SharePoint.

I followed these two tutorials to create a User Profile Service & the My Site: http://sharepointgeorge.com/2010/configuring-the-user-profile-service-in-sharepoint-2010/ http://www.boostsolutions.com/blog/how-to-create-configure-my-sites-in-sharepoint-2010/

Any help would be really appreciated. Thanks!

  • @WaqasSarwarMVP Yes, I've already done it. The safecontrol is already defined in the manifest. The thing is that the Webpart is working fine on my root site. But showing the not registered as safe error on my custom created my site. – veggiedude May 22 '17 at 5:53
  • I have temporarily fixed the issue by manually writing the safecontrol statement in my site's web.config. But I believe that it should be automatically added there, shouldn't it? – veggiedude May 22 '17 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.