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
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