ASP.Net MVC 3.0でAutofac 2.4.4を使用してhttp://code.google.com/p/autofac/wiki/MultitenantIntegrationバージョン2.4.4を使用しています。Autofac Contrib Multi Tenantが「このコンテキストではリクエストを利用できません」という例外をスローする
新しいAsp.Net MVC 3サポート(AutofacDependencyResolverを使用)を使用します。テナント識別戦略クラス(ITenantIdentificationStrategyの実装)が「このコンテキストではリクエストを利用できません」という例外が発生するという問題が発生しました。
私はAutofacContrib.Multitenant.Web.RequestParameterTenantIdentificationStrategyクラスを使用しようとしましたが、同じ例外がスローされます。
私のApplication_Startは
protected void Application_Start()
{
//wire up all the necessary objects used in this web application
IContainer container = BootStrap.RegisterAll().Build();
//multi tenant support
MultitenantContainer multiTenant = new MultiTenancy().Register(container);
DependencyResolver.SetResolver(new AutofacDependencyResolver(multiTenant.BeginLifetimeScope()));
}