Permalink
Browse files

Changed Container lifestyle from PerWebRequest to Transient

(PerWebRequest can't be configured on the clientside)
  • Loading branch information...
1 parent bf2c764 commit e76ee61788880fc6befb9e647e3eb6caeb988190 @Tigraine committed Sep 30, 2009
Showing with 5 additions and 6 deletions.
  1. +5 −5 src/ELMSConnector/ConventionBasedContainerFactory.cs
  2. +0 −1 src/ElmsConnector.Web/Web.config
@@ -53,7 +53,7 @@ public IWindsorContainer RegisterServices(IWindsorContainer container)
AllTypes.Pick().FromAssembly(assembly)
.If(p => p.Namespace.EndsWith("Services") || p.Namespace.EndsWith("Commands"))
.Configure(p => p.Named(p.Implementation.Name))
- .Configure(p => p.LifeStyle.Is(LifestyleType.PerWebRequest))
+ .Configure(p => p.LifeStyle.Is(LifestyleType.Transient))
.WithService.FirstInterface());
return container;
}
@@ -62,16 +62,16 @@ public IWindsorContainer RegisterFactories(IWindsorContainer container)
{
container.Register(
Component.For<HttpRequest>()
- .LifeStyle.PerWebRequest
+ .LifeStyle.Transient
.UsingFactoryMethod(() => HttpContext.Current.Request),
Component.For<HttpResponse>()
- .LifeStyle.PerWebRequest
+ .LifeStyle.Transient
.UsingFactoryMethod(() => HttpContext.Current.Response),
Component.For<HttpSessionState>()
- .LifeStyle.PerWebRequest
+ .LifeStyle.Transient
.UsingFactoryMethod(() => HttpContext.Current.Session),
Component.For<HttpServerUtility>()
- .LifeStyle.PerWebRequest
+ .LifeStyle.Transient
.UsingFactoryMethod(() => HttpContext.Current.Server));
return container;
}
@@ -63,7 +63,6 @@
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
- <add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.MicroKernel" />
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>

0 comments on commit e76ee61

Please sign in to comment.