无法显示或导入此页面上的Web部件或Web窗体控件.该类型未注册为安全.Sharepoint 2010

ren*_*ene 2 sharepoint-2010

我遇到了上面提到的错误.我已经通过Powershell(add-spsolution,install-spsolution)和管理中心以3种不同的方式成功部署了webpart,throgh stsadm.Webpart是.wsp,它在Sharepoint 2007中运行没有任何问题.我已经更改<safe control>了web.config中的条目.

  <SafeControl Assembly="TimeRecordingWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Namespace="TimeRecordingWP" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="true" />
  <SafeControl Assembly="TimeRecordingWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Namespace="TimeRecordingWP.Controls" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="true" />
  <SafeControl Assembly="TimeRecordingWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Namespace="TimeRecordingWP.Util" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="true" />
  <SafeControl Assembly="TimeRecordingWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Namespace="TimeRecordingWP.Dao" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="true" />
Run Code Online (Sandbox Code Playgroud)

我已将<trust>参数更改为Full但未成功.Webpartcatalog中的预览 - >所有webparts和webpart都不会显示此帖子标题中指定的消息.我很丢失.

提前致谢..

nik*_*s-e 7

我设法解决了这个问题.

我的情况是:

  • 使用Visual Studio 2010创建新的Visual Web部件
  • 复制了类似项目的一些东西
  • 将一些属性重命名为项目特定的名称
  • 尝试将webpart添加到页面时出现此错误.

解决我的问题的方法:更改了SharePointProjectItem.spdata(隐藏文件)中SafeControl的Namespace值,以匹配我使用的实际命名空间

希望这可以帮助 :)