I deployed a SharePoint solution consisting of 4 webparts. When I try to add one to a page on my SharePoint site, it gives me this error: "a web part or web form control on this page cannot be displayed or imported. the type could not be found or it is not registered as safe."

I've read that I need to add a Safe Control element to web.config and each webpart's Elements.xml file. I took care of that, and double-checked the namespace values on all aforementioned files. But I also read that third-party DLLs need to be signed.

So what is considered a third-party DLL? Anything that does not have Microsoft in its name or a DLL that the project generated? Are there steps I'm missing? If the solution is safe and I still receive that error, then how do I ensure that the "type" (whatever that is) is "found"?

Note: I am using Visual Studio 2010 and SharePoint Server 2010, product version 14

1 Answer 1


Custom developed web parts get the safe control entry automatically added, when it is created in Visual Studio 2010 and deployed . Only Refactoring the name or namespace of the web part class will break that safe control entry. OR

This is common error if you eg. changed WebPart name after creation and/or changed its namespace.

If you are working on SharePoint 2010 and most likely with Visual Studio 2010 in VS project:

Select your custom webpart Use right click > Properties In properties windows under SharePoint find Safe Control Entries Click ... button Verify your settings (namespace) Retract your solution and delete your web part from Web Part Gallery (this can be your first step). Rebuild, package and deploy your project.

You don't need to edit your web.config manually!

  • mention the version of sharepoint in tags for all questions .
    – Nikhil J
    Sep 5, 2014 at 1:14
  • I need to ask one thing about web parts' namespaces. Let's say I have a visual web part called X and within it I have a web part called ZZ. The project is called SP-Project. Its namespace should be SP-Project.X.ZZ, right?
    – Chris
    Sep 5, 2014 at 16:41
  • yes you are right
    – Nikhil J
    Sep 5, 2014 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.