web part迁移到sharepoint 2010后error的解决

问题描述:

一些站点上的ListingSummary webpart在升级到moss(sharepoint) 2010后,无法正确显示,得到的报错信息如下:

英文报错:

 "Web Part 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."
 

中文报错:

 Web 部件错误: 此网页上的某个 Web 部件或 Web 表单控件无法显示或导入。找不到该类型,或该类型未注册为安全类型。

 

解决方案:

从moss2007的页面导出webpart

web part迁移到sharepoint 2010后error的解决

 

得到类似“news.webpart”的文件.然后使用记事本打开,将原有内容:

 <type name="Microsoft.SharePoint.Portal.WebControls.ListingSummary, Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
 

替换为:

 <type name="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
 

 然后在moss2010的页面进行导入

web part迁移到sharepoint 2010后error的解决 

web part迁移到sharepoint 2010后error的解决

 

还有一种未证实的方案:

到站点的webconfig,使用"SafeControl Assembly"将webpart注册.


 相关资料:

http://social.msdn.microsoft.com/Forums/zh-HK/sharepoint2010setup/thread/96b497a7-8daf-460b-aa60-c209b565534f

 

amonteiro
(Partner)
30
 

I have a lot of ListingSummary webparts that don't work after upgrading to SharePoint 2010. It throws the below error on the webpart page, however no errors in the upgrade process.

"Web Part 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 ListingSummary webpart is a SharePoint webpart from SharePoint 2003 that was upgraded into the 2007 environment (I believe). In the 2007 environment when I export the webpart it has a reference to

Microsoft.SharePoint.Portal.WebControls.ListingSummary, Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

from what I understand the correct reference in SharePoint 2010 should be to

Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

Ofcourse I can manually export the webpart from 2007, edit it to the right reference, and import it to 2010 to get it to work (which I have tried and it works). However there are too many of these to do manually.

I have also tried writing a C# application to loop through all webparts in the sharepoint 2010 instance post upgrade; however the listingsummary webparts are returned as ErrorWebParts and therefore can't be exported or edited in code (from what I understand).

 

所有回覆

 Hello,

The Listingsummary Webpart was made obsolete in 2007 and was replaced by the content query webpart.  SharePoint 2010 does not contain the Listingsummary class and therefore is giving the error.  Manual import to a content query webpart is the recommended and only solution.

From: http://technet.microsoft.com/en-us/library/cc179142(office.12).aspx

 SharePoint Portal Server 2003 listings do not exist in Microsoft Office SharePoint Server 2007.

 Migration path: During upgrade, areas are automatically moved to Webs and bucket Web URLs are removed. Favorites and other externally saved links must be changed. Upgrading automatically moves listings to an Office SharePoint Server 2007 list and a CBQ Web Part. It is recommended that users manually move the data to the summary links feature to receive all of the benefits of easy in-page link editing. To do this, users must add a summary links Web part or control to the page, and then manually copy links from the upgraded list to the summary links Web part. 

This following article shows the listingsummary class as obsolete in 2007.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.portal.webcontrols(office.12).aspx

本文转自    yuxye   51CTO博客,原文链接:http://blog.51cto.com/fishvsfrog/687856

上一篇:《深入分析GCC 》——3.2 GCC的逻辑结构


下一篇:ELK6.6.1-轻松破解elasticsearch x-pack插件