perwebrequest

Setting PerWebRequest Lifestyle In NHibernate

I have a pretty basic NHibernate setup. I am not using Castle Widnsor or anything special like that to do IoC in my code. All I want to do is set my Lifestyle to PerWebRequest, but I cannot figure out how to do this with out going back through my code and updating it to use an IoC library. Is there any way to do this in the config f...

Castle Windsor PerWebRequest LifeStyle and Application_EndRequest

Hi Gang, I'm registering some components related to Linq2Sql using PerWebRequest lifestyle. I see them get created, but they get destroyed before my global's Application_EndRequest method gets called. Is that by design? Does anyone know a work around? I want to call commit on my UnitOfWork object to submitchanges() at the end of e...

Some objects created with PerWebRequest are not garbage collected at the end of web request.

Given public class a : IDisposable { public static int counter; public a() { counter++; } ~a() { counter--; } public void Dispose() { } } With registration: application_container = new WindsorContain...

castle PerRequestLifestyle not recognize

Hi all, New to Castle/Windsor, please bear with me. I am currently using the framework System.Web.Mvc.Extensibility and in its start up code, it registered HttpContextBase like the following: container.Register(Component.For<HttpContextBase>().LifeStyle.Transient.UsingFactoryMethod(() => new HttpContextWrapper(HttpContext.Current))); ...

Windsor PerWebRequest resolution in Application_Start

I am injecting HttpContextBase into a caching class. HttpContextBase is registered as PerWebRequest. I interact with the caching class on each web request and this works fine, but I also need to initialise the cache at application start. I understand that PerWebRequest does not work in Application_Start though: http://stackoverflow.com...