Reputation: 1445
I am using this link http://msdn.microsoft.com/en-us/library/bb861909.aspx
The adding a SafeControl to the web.config works good. But the removing does not work! What is wrong?
Here in comments you can see the same problem http://blog.thekid.me.uk/archive/2007/03/20/removing-web-config-entries-from-sharepoint-using-spwebconfigmodification.aspx
Upvotes: 1
Views: 2619
Reputation: 69
I tried modifying the manifest.xml file to change the SafeControl because I had changed the namespace for the webpart. Unfortunatly when I did a Deploy it kept overwritting the changes I made in the manifest.xml file. To change the namespace of a webpart so it gets compiled to the manifest.xml file correctly click on the webpart in your Visual Studio 2010 project and edit the Safe Control Entries section and in there you can modify the namespace.
Upvotes: 0
Reputation: 3777
If removing entries added using SPWebConfigurationModifications (SPWCM) fails the cause is usually:
But an other question is why do you want to add SafeControl entries using code?
SafeControl entries should be added by entries in the manifest.xml of the WSP package which adds the dll
Upvotes: 3