What if I release the components manually by using the
ComponentDestroyed event? Is there anything wrong with this?
static void Kernel_ComponentDestroyed(ComponentModel model,
object instance)
{
if (model.LifestyleType == LifestyleType.PerWebRequest)
masterContainer.K
According to the following comment in PerWebRequestLifestyleManager,
it sounds like UsingFactoryMethod and PerWebRequest are not compatible
to each other as-is
public override bool Release(object instance)
{
// Since this method is called by
Briefly speaking, our system uses UsingFactoryMethod in a few places
like the following:
container.Register(Component
.For()
.UsingFactoryMethod(k => new
SqlRepositoryRegistry(this.connectionString, _schema))