SafeControls Entries in Manifest can be changed during deployment

I had a slightly unusual situation. We’ve a customer who has using the Telerik RadEditor version 4.5.6 for SharePoint 2007. They’re upgrading to SharePoint 2010, and want their existing content to continue to work.

They’ve using the Telerik RadEditor web part quite a lot, so we had to keep that working. We’ve put in Assembly Binding Redirects using an SPWebConfigModification (more on that in a later post).

However, we also needed to put in the SafeControl entry for the old assembly. Continue reading “SafeControls Entries in Manifest can be changed during deployment”

Advertisements
SafeControls Entries in Manifest can be changed during deployment

Adding and removing Web config modifications

When building an application for SharePoint, if you’re making changes to the Web.config, they should be deployed SPWebconfigModifications. This isn’t that easy, really, but works well enough, and there are good articles about how to add them – but my code looks like:

SPWebConfigModification modification = new SPWebConfigModification(
     "add[@name='MyNavProvider']",
     "configuration/system.web/siteMap/providers");
modification.Value = "<add name="MyNavProvider" type="{Assembly info here!}" />";;
modification.Sequence = 0;
modification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
modification.Owner = "MyConfigModification;

webApp.WebConfigModifications.Add(modification);
webApp.Update();

That works, but what about removing them? It’s important to do this – otherwise you can cripple a system. Continue reading “Adding and removing Web config modifications”

Adding and removing Web config modifications