unable to add the selected web part,a web part or web form control can not be displayed or imported.the type is not registered as safe

Developer
Sep 19, 2008 at 9:44 AM
Quoted from comments page:

hi,

when i'm trying to add the faceted search web part,i got the follwing error as "unable to add the selected web part,a web part or web form control can not be displayed or imported.the type is not registered as safe".I also cheked the web.config file of my site..but i could n't find the things..
can anyone help me
thanks..


Answer:

If you have installed Faceted Search via the CodePlex released files then you should not encounter this problem and the solution depends on how reliant you are on Faceted Search.

If this is a development environment, then I would suggest removing all instances of Faceted Search from the solution store/Web Part Gallery etc. and reinstall completely

If this is a production environment, then you need to edit your web.config, in the SafeControls section and ensure that the PrivateKeyToken for your Faceted Search assembly matches the one that is listed.  If you've made some modifications you should remove it from the Web Part Gallery and re-add it, as an old residual PrivateKeyToken could still remain.

Please post another message if this does not solve your problem.

Thanks,

Shaun O'Callaghan
Nov 19, 2008 at 7:56 PM
Edited Nov 19, 2008 at 7:57 PM
"If this is a production environment, then you need to edit your web.config, in the SafeControls section and ensure that the PrivateKeyToken for your Faceted Search assembly matches the one that is listed.  If you've made some modifications you should remove it from the Web Part Gallery and re-add it, as an old residual PrivateKeyToken could still remain."

I have followed the intructions exactly and it looks like this is the only thing holding me back. I have no such lines and most online forums suggest that we have to add that line manually. There is no consensus as to what the statement should say. Can you post a statement for WSS3.0 + SSX?
Nov 21, 2008 at 7:06 PM
I was able to resolve this issue.

I am using a WSS 3.0SP1 + SSX 2008 farm and was assuming that my search server web.config edits were sufficient.
Though the event logs, I noticed that the intranet site I was working with was having token errors despite previous attempts to remedy this.
With the support of some kind souls, I was able to use this line and achieve success:

//add this line exactly as it appears to the safecontrols section of the web.config of your front end site:

<SafeControl Assembly="Microsoft.SharePoint.Portal.ExtendedSearch, Version=2.5.0.0, Culture=neutral, PublicKeyToken=a646907c4a695009" Namespace="Microsoft.SharePoint.Portal.ExtendedSearch.WebControls" TypeName="*" Safe="True" />

Once that worked, breadcrumbs were working but I still was not able to get the facet search webpart to come up; I would get an unknown error.
Eventually I realized that I needed to excute the entire procedure set on my front-end server. Once the DLLs were registered and i ran a repair on the facet install,
everything worked well.

Currently the only issue that I am facing is that in I cannot get search boxes, such as the one on my homepage to abide b the parameters in 'search settings.'
I still get routed to: _layouts/OSSSearchResults.aspx even though I have entered: /search/Pages as intructed*
Hopefully I can get this sorted out soon.

*the name of my search center is simply 'search'