In order to use the same web.config file on IIS7 and older versions, put the SessionScopeWebModule in the section like this:
<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ar.sessionscope" type="Castle.ActiveRecord.Framework.SessionScopeWebModule, Castle.ActiveRecord" />
in addition to the original <system.web>
section settings:
<configuration>
<system.web>
<httpModules>
<add name="ar.sessionscope" type="Castle.ActiveRecord.Framework.SessionScopeWebModule, Castle.ActiveRecord" />
Make sure you set the <validation validateIntegratedModeConfiguration="false"/>
in the <system.webServer>
section as well.