Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
SDK Documentation
General Reference
Administration
 How To: Add Custom Configuration Se...
Community Content
In this section
Statistics Annotations (4)
This page is specific to
The 2007 product release

Other versions are also available for the following:
How To: Add Custom Configuration Settings to Extend a Web Application

The \\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG folder contains .config and .xml files that are used together to create the Web.config file for a Web application when it is extended with Windows SharePoint Services. Before copying the Web.config file from the \CONFIG folder to the root folder of the Web application, Windows SharePoint Services searches the \CONFIG folder for any .xml file with a name in the format webconfig.*.xml and merges its contents with the Web.config file before writing the resulting Web.config file to the root path of the Web application. The actions defined in the .xml file are applied to the configuration settings of the Web application. A major advantage to using an .xml file to supplement the Web.config file is that customizations are not lost when Windows SharePoint Services is upgraded and the Web.config file is overwritten.

Example

When saved as webconfig.myName.xml in the \CONFIG directory, the following example adds a safe control and replaces the run-time filter for the resulting Web.config file that is created when a Web application is extended.

Xml
<actions>
   <add path="configuration/SharePoint/SafeControls">
      <SafeControl
         Assembly="System.Web, Version=1.0.5000.0, Culture=neutral, 
            PublicKeyToken=b03f5f7f11d50a3a"
         Namespace="System.Web.UI.WebControls"
         TypeName="*"
         Safe="True"/>
   </add>
   <remove path="configuration/SharePoint/RuntimeFilter"/>
   <add path="configuration/SharePoint">
      <RuntimeFilter
         Assembly="Company.Product, Version=1.0.1000.0, 
            Culture=neutral, PublickKeyToken=1111111111"
         Class="MyRuntTimeFilter",
         BuilderUrl="MyBuilderUrl"/>
   </add>
</actions>

The example adds a new SafeControl child element on the path configuration/SharePoint/SafeControls, removes the RuntimeFilter element from the configuration/SharePoint/RuntimeFilter path, and adds a new RuntimeFilter element on the configuration/SharePoint path.

You can retroactively apply changes to the Web.config files of the server by running the copyappbincontent Stsadm command-line operation. You must run the operation on each front-end Web server in the deployment.

For general information about the Web.config files used in a Windows SharePoint Services deployment, see Working with Web.config Files

Caution Caution:

Changes that you make to Web.config may be overwritten when you install updates or service packs for Windows SharePoint Services, or when you upgrade an installation to the next product version.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
There is a typo in above xml block - Look at the &lt;Remove&gt; element      sheetalkjain ... Thomas Lee   |   Edit   |   Show History
<remove  path="configuration/SharePoint/RuntimeFilter/" >

the "/" should be outside the code. It shoul be

<remove path="configuration/SharePoint/RuntimeFilter" />

Thanks

Sheetal

http://office12/blogspot.com

www.docstree.com

Edit existing nodes?      JoshGav   |   Edit   |   Show History
It seems the only way to edit existing nodes is to remove and re-add them. Is this true? This makes modifying higher-level nodes impractical.
Multiple Web Application issue      SandeepKNahta ... Thomas Lee   |   Edit   |   Show History
In case you have more than one Web Application, in this approach there is no way to restrict the merging of web configs for a particular port.
webconfig.xyz.xml is added more than once      Ant __   |   Edit   |   Show History
If you only want your webconfig.xyz.xml file to be applied only once (rather than everytime someone calls stsadm -o copyappbincontent) then you need to include a unique guid called 'id'.

<actions>
<add path="somewhere" id="{your-configfile-specific-guid}">
....
....
</add>
</actions>
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker