SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have deployed a webpart to my MOSS 2007 environment and have the following 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."

The strange part of this is, that the sharepoint site sits on 2 front end web servers that are load balanced, one of the web servers displays the webpart fine, and the other one gives the error.

web.config on both servers is the same, the .dll for the webpart is on both web servers in the appropriate bin directory and with the same permissions.

also to note, the webpart was deployed on the central admin server which is a separate server to both web servers.

the event log doesn't display anything to give any hints as to why this is failing, how can I troubleshoot it?/resolve it?

share|improve this question

If the assembly failed to load once the .Net runtime will remember this failure for the lifetime of the process.

Fortunately assembly loading issues are usually reported in the ULS log.

You should try

  • Trigger the error on the bad web server

If you search for the name of your WebPart assembly in the hopefully short logfile it might reveal an Assembly load error.

If it is an assembly load error then.


  • Check that all dependent Assemblies are present on the bad front end server. -You can use .Net reflector to determine the dependencies of your WebPart Assembly.
  • Enable the fusion log and repeat the above set of steps.
share|improve this answer

Does the Webpart file reference the correct dll? Were there any name or namespace changes?

You can go to the web part gallery for the site collection and access the webpart file. You can also generate a new one from the registered dll by clicking the "new" option and selecting the associated dll. That should give you a better idea if it is the webpart file or the associated dll.

share|improve this answer
When I travel to the webpart gallery, the webpart is visable for both web servers. however, when i click 'new' the webpart is only visable on the working server.. So, from your summary here it would seem the associated dll is the issue? the dll is on the server in the bin directory, any idea how to resolve?? – Anonymous Oct 13 '10 at 0:37
How was the web part originally deployed? If you used a package you could try deploying it again on the server that doesn't work. It is already in the wp or solution store so just the deployment part. – Mike Oryszak Oct 13 '10 at 17:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.