views:

135

answers:

2

I'm using ASP.Net MVC (still 1.0 for now) with Castle ActiveRecord and NHibernate.Linq. All is fine under IIS 6.

However, I'm faced with a problem deploying my app to IIS 7: ActiveRecord's SessionScope.Current seems to be not available for some reason.

Any ideas?

A: 

If you're using IIS 7 Integrated Mode you need to register the ActiveRecord HttpModule in the system.webServer/modules section instead of system.web/httpModules

See

Mauricio Scheffer
A: 

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.

Yngvar