Castle windsor instances are registered as singleton even though explicitly declare per web request
问题 I am explicitly declaring my registerations as per web request lifecycle but they are still singletons. this is a problem because my command handlers depend on an IDbConnection which is also registered per web request. here is my registration code: container.Register( Classes .FromAssemblyContaining<EcruiterCommands>() .BasedOn(typeof (ICommandHandler<>)) .WithService.AllInterfaces() .LifestylePerWebRequest()); 回答1: I found the issue, the culprit is this line: .BasedOn(typeof (ICommandHandler