में संस्थापक नहीं मिल सकता है मैं अपने 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));
//...
}
जब मैं Global.asax डिबग, कोड FromAssembly.InDirectory(newAssemblyFilter(AppDomain.CurrentDomain.RelativeSearchPath))
पाता है सब अपने प्रोजेक्ट dll के (देखते हैं 7 dll के)। उनमें से इंटरफ़ेस के कार्यान्वयन, उदाहरण के लिए शामिल हैं:
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);
}
}
लेकिन जब मैं breakpoints सेट, यह केवल 1 संस्थापक कहा जाता है, 2 अन्य छोड़ दिया गया था है। यह मजाकिया है, लेकिन मेरे पास प्रोजेक्ट है जो मैंने कोड कॉपी किया है।
हे भगवान! यह बहुत बेवकूफ गलती :) बड़ा धन्यवाद! –
हम सभी को, हर समय होता है :) – Marijn