Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Registering SPS web parts as safe?

  Asked By: Dana    Date: Jul 01    Category: Sharepoint    Views: 2412

I have a problem adding SPS built-in web parts, such
as PageViewer webpart and ImageViewer webpart. The web
part added seems fine, but it is always of type
ErrorWebPart. Then I was not able to change the
properties such as ContentLink for the web part.

Visiting the Web Part gallery for the site, e.g.,
https://myServer/managedPath/TEST/_catalogs/wp/Forms/AllItems.aspx,
I see many SPS standard web parts such as
MSPageViewer.dwp, MSImage.dwp, etc. However, when
clicking any one of them, I got this error:

A Web Part or Web Form Control on this Web Part Page
cannot be displayed or imported because it is not
registered on this site as safe.

SPWebPartCollection from GetWebPartCollection() shows
SPWebPart.ToString() as
Microsoft.SharePoint.WebPartPages.ErrorWebPart.

This problem doesn't happen to my other servers. For
example, from the same Web Part Gallery page, Image
Web Part shows a beautiful earth image.

I didn't need to do anything special for SPS built-in
web parts for my other servers. I use stsadm to
register my custom web parts as safe.

So, something might have been corrupted.

Where should I look for the root cause and the fix?

Share: 

 

12 Answers Found

 
Answer #1    Answered By: Laura Walker     Answered On: Jul 01

The web.config would be the first place to look.

 
Answer #2    Answered By: Kalyan Pujari     Answered On: Jul 01

I checked the web.config file from different server
and didn't see any difference.

Any special  lines in particular for SPS web  parts?

 
Answer #3    Answered By: Katy Patton     Answered On: Jul 01

Yeah, the <SafeControls> section. If you haven’t done anything to the assembly itself, it would make sense that the config file is the culprit. You might also use the VS command line to compare public key tokens if a missing line in the config file isn’t the problem.

 
Answer #4    Answered By: Ana Payne     Answered On: Jul 01

These lines exist in the web.config and are the same
aross my different servers  (all but one work). They
all look general and I don't see any line is specific
for particular webparts:

<SafeControls>
<SafeControl Assembly="System.Web,
Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
Namespace="System.Web.UI.WebControls" TypeName="*"
Safe="True" />
<SafeControl Assembly="System.Web,
Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
Namespace="System.Web.UI.HtmlControls" TypeName="*"
Safe="True" />
<SafeControl Assembly="Microsoft.SharePoint,
Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
Namespace="Microsoft.SharePoint" TypeName="*"
Safe="True" />
<SafeControl Assembly="Microsoft.SharePoint,
Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
Namespace="Microsoft.SharePoint.WebPartPages"
TypeName="*" Safe="True" />
<SafeControl Assembly="Microsoft.SharePoint,
Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
Namespace="Microsoft.SharePoint.WebControls"
TypeName="*" Safe="True" />
<SafeControl Assembly="Microsoft.SharePoint,
Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
Namespace="Microsoft.SharePoint.ApplicationPages"
TypeName="*" Safe="True" />
<SafeControl Assembly="Microsoft.SharePoint,
Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
Namespace="Microsoft.SharePoint.SoapServer"
TypeName="*" Safe="True" />
<SafeControl Assembly="Microsoft.SharePoint,
Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
Namespace="Microsoft.SharePoint.Meetings" TypeName="*"
Safe="True" />
<SafeControl
Assembly="Microsoft.SharePoint.Portal,
Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
Namespace="Microsoft.SharePoint.Portal.WebControls"
TypeName="*" />
<SafeControl
Assembly="Microsoft.SharePoint.Portal,
Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
Namespace="Microsoft.SharePoint.Portal.WebControls.Alerts"
TypeName="*" />
</SafeControls>

A custom web  part has a line like this:
<SafeControl Assembly="MyWebPart, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=58762231adc5c680"
Namespace="TestWebPart2" TypeName="*" Safe="True" />

But you are not suggesting me to add one for each of
SPS web parts? Are you? If so, how to do that?

 
Answer #5    Answered By: Christop Mcfadden     Answered On: Jul 01

Everything looks fine  with the attributes below … this is strange. The next thing I would do is comment out the custom web  part entry to eliminate it – the rest are standard  OTB entries. The OTB Web parts  should inherit from the SafeControls already listed in the config file so you should not have to enter those again.

If commenting out the custom  entry doesn’t work, you might want to rename the web.config file, replace it with a copy from a working server and reset IIS to see if that fixes it (stretching a little here but I’ve seen stranger things J ). A ‘Safe” control  takes the assembly name, public key token, and the namespace from the Web part  and compares it to the one being displayed  … should not be an issue with OTB Web parts and config file.

 
Answer #6    Answered By: Lacey Daniels     Answered On: Jul 01

You can occasionally get this error  in error when the problem  is with
the trust level. What level is set in the web.config of the broken
server?

 
Answer #7    Answered By: Megan Martin     Answered On: Jul 01

I actually set that to Full............

 
Answer #8    Answered By: Donta Kirkland     Answered On: Jul 01

Several other weird things happened to this new
server:

1. A seemly successful "stsadm -o addwppack" doesn't
add the web  part to Virtual Server Gallery.

2. Creating a portal after New Web site  from IIS
results in an error  (still at 0%):
Portal creation job exception.
(status=PortalAdminJobStatusFailed)
System.MissingMethodException: Method not found: 'Void
Microsoft.SharePoint.Library.SPRequestInternalClass.ExtendVirtualServer(Boolean,
System.String, System.String, System.String,
System.String, System.String, System.String, Boolean,
System.String ByRef, Boolean, System.String,
System.String, Boolean)'. at
Microsoft.SharePoint.Library.a.a(Boolean A_0, String
A_1, String A_2, String A_3, String A_4, String A_5,
String A_6, Boolean A_7, String& A_8, Boolean A_9,
String A_10, String A_11, Boolean A_12) at
Microsoft.SharePoint.Administration.SPGlobalAdmin.a(Boolean
A_0, String A_1, String A_2, String A_3, String A_4,
Uri A_5, Boolean A_6, String A_7, Boolean A_8, String
A_9, String A_10, Boolean A_11) at
Microsoft.SharePoint.Administration.SPGlobalAdmin.ExtendVirtualServer(Uri
uri, Boolean bCreateNewAppPool, String strAppPoolId,
Boolean bConfigurableAppPoolAccount, String
strAppPoolUserName, String strAppPoolPassword, Boolean
fEnsureNTLM) at
Microsoft.SharePoint.Administration.SPGlobalAdmin.ExtendVirtualServer(Uri
uri, Boolean bCreateNewAppPool, String strAppPoolId,
Boolean bConfigurableAppPoolAccount, String
strAppPoolUserName, String strAppPoolPassword) at
Microsoft.SharePoint.Portal.Install.c.a(j A_0, String
A_1, Uri A_2, String A_3, String A_4, Int32 A_5,
String A_6, String A_7, String A_8, String A_9, String
A_10, String A_11, SPVirtualServer& A_12) at
Microsoft.SharePoint.Portal.Install.c.a(IDictionary
A_0) at
System.Configuration.Install.Installer.Install(IDictionary
stateSaver) at
System.Configuration.Install.TransactedInstaller.Install(IDictionary
savedState)

The portal is created with a virtual server other than
the default web site that has 80 as the portal number.
Then my system Admin made the default web site to
default-redirect to my portal.

I hope the above information give more details for
other suggestions.

 
Answer #9    Answered By: Cade Velazquez     Answered On: Jul 01

Time to uninstall and reinstall SharePoint?

 
Answer #10    Answered By: Ariana Christensen     Answered On: Jul 01

Talking to my sys admin got the same response; the install is hosed!

 
Answer #11    Answered By: Gopal Jamakhandi     Answered On: Jul 01

Ok I need to re-install the SPS server. That is a lot
of fun.

Is there any way to preserve whatever I have? In
another word, do I need to start all over for my
config database, portal site, etc.

Thanks both of you for spending time on my problem(s).

 
Answer #12    Answered By: Kyla Eckert     Answered On: Jul 01

It depends on how much you have. I typically start over if I can. It
only takes 15 or 20 minutes to uninstall and reinstall SharePoint. I
often even uninstall and reinstall the Application Server Role (IIS,
.NET Framework, etc.)

Otherwise, you will want to backup your content databases. Never backup
your config database, always recreate it.

 
Didn't find what you were looking for? Find more on Registering SPS web parts as safe? Or get search suggestion and latest updates.




Tagged: