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?

2 Answers 2


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.

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.

  • 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, 2010 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. Oct 13, 2010 at 17:02

Your Answer

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