Unable to add selected web part(s).

I am working in sharepoint for quite a while Now. Developing and deploying the webparts is what i am doing since i have started working on sharepoint. Most common error i found is “Unable to add selected web part(s). Cannot import WebPart1, Type is not registered Safe“. I found a solution to this, So I am sharing my thoughts with you. Hope this helps someone.

This error is very common error while deploying a webpart through “dwp.”. It can occur for two main reasons.

1)  No safe control entry in the web.config file.

2)  Spell mistake in the safe controls entry.


1) In first case,  if there is no entry in the web.config file. then add the safe control entry.

<SafeControl Assembly=”Welcome, Version=, Culture=neutral, PublicKeyToken=9f4da00116c38ec5″ Namespace=”NameSpace” TypeName=”NameSpace.ClassName” Safe=”True” />

2) In second case, if the entry is already there, then you have to check the Namesapce and TypeName

Remember that Namespace and TypeName are case Sensitive. So check the case. And also check that typeName is Namespace Qualified ClassName see the safe control Entry above in bold.

Also Check the case and Spelling in Manifest.xml of your webpart solution.

Hope this helps


~ by Deepak Jethani on July 10, 2008.

One Response to “Unable to add selected web part(s).”

  1. I had the same problem. For me, the reason was that the Visual Studio Sharepoint Webpart Template created the following entry in the .webpart file:

    Now, as I deploy manually, it was not true what that xml comment says that the type name would automatically be replaced. So, I had to put the type name there by myself:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: