Sharepoint 2010 将ContentEditorWebPart添加到安全控件列表中

Sharepoint 2010 将ContentEditorWebPart添加到安全控件列表中,sharepoint-2010,web-parts,safecontrols,Sharepoint 2010,Web Parts,Safecontrols,我需要在安全控件列表中添加ContentEditorWebPart,因为。除非有更好的办法 问题是,我不想手动添加它,我想在删除解决方案时自动添加 因此,我尝试将我的安全控件添加到需要以下内容的模块的.spdata中,如下所示: <SafeControls> <SafeControl Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9

我需要在安全控件列表中添加ContentEditorWebPart,因为。除非有更好的办法

问题是,我不想手动添加它,我想在删除解决方案时自动添加

因此,我尝试将我的安全控件添加到需要以下内容的模块的.spdata中,如下所示:

<SafeControls>
    <SafeControl Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint.WebPartPages" TypeName="ContentEditorWebPart" Safe="True" />
</SafeControls>

但是当我检查web.config时,它会将程序集更改为我的项目程序集

如果我将它添加到包中,我必须使用它部署Sarepoint dll


那么,将其添加到安全控件的最佳方式是什么呢?

为了记录,我决定添加一个功能接收器,它将使用
spwebconfig修改
将安全控件添加到web.config


有关详细信息,请参见在本例中使用
SPWebConfigModification
。 通过编辑文件
Package.Template.Xml
,可以存档此功能:

<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/">
<Assemblies>
  <Assembly Location="Telerik.Web.UI.dll" DeploymentTarget="GlobalAssemblyCache">
    <SafeControls>
      <SafeControl Assembly="Telerik.Web.UI, Version=2012.2.912.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TypeName="*" Safe="True" SafeAgainstScript="False" />
    </SafeControls>
  </Assembly>
</Assemblies>
</Solution>

在本例中,我在Web.config的安全控件中添加了assembly
Telerik.Web.UI.dll