でインストーラを見つけることができません:私は、Global.asaxのをデバッグするとき城ウィンザーは私global.axaxでコードを持っているアセンブリ
protected void Application_Start()
{
WindsorContainer = new WindsorContainer();
WindsorContainer.Install(FromAssembly.InDirectory(new AssemblyFilter(AppDomain.CurrentDomain.RelativeSearchPath)));
ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory(WindsorContainer.Kernel));
//...
}
は、コードFromAssembly.InDirectory(newAssemblyFilter(AppDomain.CurrentDomain.RelativeSearchPath))
が検出したすべての私のプロジェクトのDLLの(7 DLLのがあります)。それらの 3例えばIWindsorInstaller
インターフェイスの実装が含まれます
class WindsorInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
var services = AllTypes.FromThisAssembly().Where(type => type.Name.EndsWith("Service"));
container.Register(services
.WithService.DefaultInterfaces()
.Configure(c => c.LifestyleTransient()));
container.Register(Component.For<ISession>().ImplementedBy<AspnetSession>().
LifeStyle.Transient);
container.Register(Component.For<ICache>().ImplementedBy<AspnetCache>().
LifeStyle.Transient);
}
}
をしかし、私はブレークポイントを設定したときに、それが呼ばれる唯一の1インストーラで、他の2はスキップされました。 面白いですが、私は別のの私のコピーしたコードからのプロジェクトを持っています。
ああ私の神!それはとても愚かな間違い:)ビッグ感謝! –
私たちのすべてに起こる、すべての時間:) – Marijn