When trying to modify section in the web config that is using a non-trivial type the only method that seems be available is SetRawXml. SetRawXml, as the name clearly states will update the entire element. Therefore we need to include the element tags as well as the information Here is a sample on how to update a DictionarySectionHandler