Web.config

Release 1.0 - ...

The web.config configuration file is quite large and complex, and a detailled description of each section goes beyond the scope of this site. However, some sections will be discussed separately in the following articles. Furthermore, a more comprehensive description of each section can be found on one of Microsoft's sites (e.g. MSDN or www.iis.net) and/or the Microsoft Visual Studio Documentation.

A typical web.config configuration file for a Smartsite iXperion site should contain the sections listed below.

configSections

Specifies configuration section and handler declarations. Each section element identifies a configuration section or element within the web.config and the associated ConfigurationSection-derived class that handles the configuration section or element.

XML CopyCode image Copy Code
<configSections>
   <section name="rewriter" type="Smartsite.Configuration.ProviderSectionHandler, Smartsite.Tools"/>
   <section name="Smartsite.ConfigurationSource"
       type="Smartsite.Diagnostics.LoggingBase.Common.Configuration.ConfigurationSourceSection,
             Smartsite.Diagnostics.Logging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5fdb12a67e027fb6" />
</configSections>

rewriter

Contains url rewriter configuration.

system.web

Specifies the root element for the ASP.NET configuration section and contains configuration elements that configure ASP.NET Web applications and control how the applications behave. Important elements are e.g. httpModules and httpHandlers.

A detailled description of the available elements within system.web goes beyond the scope of this site, however the article system.web describes some details for a typical Smartsite site's web.config.

location path="cms"

The web.config file can contain one or more location elements, where each element can be used to apply specific configuration settings to a specific resource (as specified within the path attribute) or to lock the configuration settings for a specifc resource.

The location element with path="cms" is used to configure access to the Smartsite manager. Note that cms should refer to a virtual directory/application within your site.

XML CopyCode image Copy Code
<location path="cms">
  <system.web>
    <authentication mode="None"></authentication>
    <authorization>
      <allow users="*" />
      <!-- allow access for all users, the manager uses it's own implementation for authenticating users -->
    </authorization>
    <httpModules>
      <clear/>
      <!-- clear the inherited httpModules -->
    </httpModules>
    <httpHandlers>
      <clear/>
      <!-- clear the inherited httpHandlers -- >
      <add verb="*" path="/cms/*.dws" type="Smartsite.Interop.IIS.Handler,Smartsite.Interop"/>
    </httpHandlers>
  </system.web>
</location>

system.serviceModel

This configuration section contains all the Windows Communication Foundation (WCF) ServiceModel configuration elements. Whereas the Smartsite.config configuration file should contain the Smartsite specific WCF services that must be initialized during site startup, this element must contain the specific configuration for each of these services.

The article system.serviceModel contains a more in-depth description of this element.

system.diagnostics

Optional element to specify trace listeners that collect, store, and route messages and the level where a trace switch is set.
In a Smartsite specific web.config used to configure and enable tracelisteners on WCF services.