Add Safe control entry in web.coinfig using SPWebConfigModification Class
SPWebConfigModification Class : Holds modifications that are made to the web.config. Following example helps you to add the safe control entry on feature activation. public override void FeatureActivated( SPFeatureReceiverProperties properties) { try { SPWebService contentService = SPWebService .ContentService; contentService.WebConfigModifications.Add(GetConfigModification()); // Serialize the web application state and propagate changes across the farm. ...