I’m trying to setup an Active Record web session per request in my WCF app. I included this in my web.config:
<httpModules>
<add
name="ar.sessionscope"
type="Castle.ActiveRecord.Framework.SessionScopeWebModule, Castle.ActiveRecord" />
</httpModules>
This was the recommended solution from the Castle docs:
http://www.castleproject.org/activerecord/documentation/trunk/usersguide/web.html
However it doesn’t work, it gives me the error:
Could not load type ‘Castle.ActiveRecord.Framework.SessionScopeWebModule’ from assembly ‘Castle.ActiveRecord’.
Did SessionScopeWebModule get moved? I’m using the latest AR dlls for .NET 4.
Indeed SessionScopeWebModule was moved to a separate project named Castle.ActiveRecord.Web. This was done so that the main Castle.ActiveRecord assembly could be used in client profile targets.
So add a reference to Castle.ActiveRecord.Web.dll and change the type in the config to: