Sunday, March 1, 2009

Update Moss Web.Config V2

The last week we spoke about another way to update sharepoint web.config by using custom xml.
I readed an excellent post of Gaetan Bouveret that give interesting details:

Specifically, he explains that we can add an "id" attribut to each node to prevent adding sames nodes twice

Samples :

To add a node like add appsetting:

<add path="configuration" id="{72DB2C92-8BC1-4767-A12C-94B67D46D0CF}">

  <appSettings />

 </add>


To update a node :

<update path="configuration/system.web">

    <siteMap defaultProvider="CurrentNavSiteMapProvider" enabled="true"/>

</update>



To delete node :

 <remove path="configuration/SharePoint/RuntimeFilter"
id="{0582988F-9C26-4990-8672-0099F4567B03}" />



Note: The "id" attribut is very important to prevent adding same nodes twice.

No comments:

Post a Comment