2
votes

I'm getting stuck with the above mentioned error. I have successfully deployed the webpart in 3 different ways, throgh stsadm, through Powershell (add-spsolution, install-spsolution) and via Central Administration. The Webpart is .wsp which ran without any problems in Sharepoint 2007. I have changed the <safe control>entries in the 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" />

I have changed the <trust>parameter to Full but no success. Neither the Preview in Webpartcatalog->all webparts nor the webpart will work showing the message named in the title of this post. I'm pretty lost.

Thank's in advance..

2

2 Answers

7
votes

I managed to fix the problem.

My case was:

  • Created new Visual Web Part with Visual Studio 2010
  • Copied some stuff from similar project
  • Renamed some properties to project-specific names
  • Got this error when tried to add the webpart to a page.

Thing that fixed my issue: Changed Namespace value of SafeControl in SharePointProjectItem.spdata (hidden file) to match the actual namespace I was using

Hope this helps :)

1
votes

Rene. I gave some thoughts to the same matter few days ago. The problem was happened when I created not an empty project and rename some properties in it to more sensible. Unfortunately, I couldn't find the reason of this problem. But I resolved it by creating an empty sharepoint project and adding the necessary items in it.