Lets take for example, my desired namespace is "C2.AcmeCorp.Relationships" and my Web Part is named "DisplayRelationships":
0) Retract your current deployed solution, just to insure cleanup of the web.config.
1) You must manually update a hidden file under the web part named "SharePointProjectItem.spdata". Visual Studio can display and edit this file, you must click the "Show All Files" icon in solution explorer in order to see it. You must manually update the SafeControl Namespace property to your new namespace name, Visual Studio does not do this for you. For example:
<SafeControls>
<SafeControl Name="SafeControlEntry1"
Assembly="$SharePoint.Project.AssemblyFullName$"
Namespace="C2.AcmeCorp.Relationships"
TypeName="*"
IsSafe="true"
IsSafeAgainstScript="false" />
</SafeControls>
2) You must insure the .webpart file type name is correct. In my example, the DisplayRelationships.webpart file should be updated to look like the following:
<metaData>
<type Name="C2.AcmeCorp.Relationships.DisplayRelationships, $SharePoint.Project.AssemblyFullName$" />
</importErrorMessage>$Resources:core,ImportErrorMessage</importErrorMessage>
</metaData>
<type Name="C2.AcmeCorp.Relationships.DisplayRelationships, $SharePoint.Project.AssemblyFullName$" />
</importErrorMessage>$Resources:core,ImportErrorMessage</importErrorMessage>
</metaData>
3) Redeploy your solution. In my example the updated web.config SafeControl entry should look like the following after I have redeployed my solution:
<SafeControls>
<SafeControl Assembly="C2.AcmeCorp.Relationships, Version=1.0.0.0 Culture=neutral, PublicKeyToken=16de7ad7af136a9"
Namespace="C2.AcmeCorp.Relationships"
TypeName="*"
Safe="True" />
</SafeControls>
<SafeControl Assembly="C2.AcmeCorp.Relationships, Version=1.0.0.0 Culture=neutral, PublicKeyToken=16de7ad7af136a9"
Namespace="C2.AcmeCorp.Relationships"
TypeName="*"
Safe="True" />
</SafeControls>
No comments:
Post a Comment