title: Method not found error in Castle Windsor / NHibernate Integration Facility after version updates
body: <p>The following exception is observed after we upgraded  Castle Windsor from 2.5.2.0 to Castle Windsor 3.3 which is the latest version - </p>
  
  <p><em>Method not found: 'Void Castle.Core.DependencyModel..ctor(Castle.Core.DependencyType, System.String, System.Type, Boolean)</em></p>
  
  <p><strong>Stack Trace:</strong> </p>
  
  <pre><code>*[MissingMethodException: Method not found: 'Void Castle.Core.DependencyModel..ctor(Castle.Core.DependencyType, System.String, System.Type, Boolean)'.]
     Castle.Facilities.NHibernateIntegration.Internal.NHSessionComponentInspector.ProcessModel(IKernel kernel, ComponentModel model) +0
     Castle.MicroKernel.ModelBuilder.&lt;&gt;c__DisplayClass6.&lt;BuildModel&gt;b__4(IContributeComponentModelConstruction c) +60
     System.Collections.Generic.List`1.ForEach(Action`1 action) +11702442
     Castle.MicroKernel.ModelBuilder.DefaultComponentModelBuilder.BuildModel(IComponentModelDescriptor[] customContributors) +223
     Castle.MicroKernel.Registration.ComponentRegistration`1.Castle.MicroKernel.Registration.IRegistration.Register(IKernelInternal kernel) +154
     Castle.MicroKernel.DefaultKernel.Register(IRegistration[] registrations) +179
     Castle.Facilities.NHibernateIntegration.NHibernateFacility.RegisterDefaultConfigurationBuilder() +398
     Castle.Facilities.NHibernateIntegration.NHibernateFacility.RegisterComponents() +221
     Castle.Facilities.NHibernateIntegration.NHibernateFacility.Init() +266
     Castle.MicroKernel.Facilities.AbstractFacility.Castle.MicroKernel.IFacility.Init(IKernel kernel, IConfiguration facilityConfig) +64
     Castle.MicroKernel.DefaultKernel.AddFacility(String key, IFacility facility) +381
     Castle.MicroKernel.DefaultKernel.AddFacility(IFacility facility) +124
     Castle.MicroKernel.DefaultKernel.AddFacility(Action`1 onCreate) +165
     Castle.MicroKernel.DefaultKernel.AddFacility(String key, Action`1 onCreate) +85
     Castle.Windsor.WindsorContainer.AddFacility(String idInConfiguration, Action`1 configureFacility) +113
     IoC.IoCBootstrapper.CreateBaseContainer(String configPath) 
     IoC.IoCBootstrapper.InitializeForWeb(String configPath) 
     Web.Global_asax.Application_Start(Object sender, EventArgs e)*
  </code></pre>
  
  <p>This is the sample code that configures NHibernate:</p>
  
  <pre><code>var container = new WindsorContainer();
  container.Kernel.ConfigurationStore.AddFacilityConfiguration("nHibernateFacility", Init());
  container.AddFacility&lt;NHibernateFacility&gt;("nHibernateFacility", f =&gt; f.ConfigurationBuilder&lt;FluentNHibernateConfigurationBuilder&gt;());
  
  
  public static MutableConfiguration Init(ProviderSchema schema, int factoryCount)
  {
  var facility = new MutableConfiguration("facility");
  facility.Attributes.Add("id", "nhibernatefacility");
  facility.Attributes.Add("isWeb", "true");
  facility.Attributes.Add("type", "Castle.Facilities.NHibernateIntegration.NHibernateFacility, Castle.Facilities.NHibernateIntegration");
  CreateFactory(facility, factoryCount, schema);
   return facility;
  }
  
  public static void CreateFactory(MutableConfiguration facility, int id, ProviderSchema schema)
  {
  var factory = facility.CreateChild("factory");
  factory.Attributes.Add("id", string.Format("nhibernate.factory{0}", id));
  factory.Attributes.Add("alias", schema.Name);
   var settings = factory.CreateChild("settings");
  
  settings.CreateItem("connection.driver_class", schema.ProviderFactory)
  .CreateItem("connection.connection_string", schema.ProviderDatabase)
  .CreateItem("proxyfactory.factory_class", "NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle")
  .CreateItem("dialect", "NHibernate.Dialect.MsSql2005Dialect")
  .CreateItem("cache.provider_class", "NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache")
  .CreateItem("cache.use_second_level_cache", "true")
  .CreateItem("cache.default_expiration", "600")
  .CreateItem("adonet.batch_size", "100")
  .CreateItem("show_sql", "false");
  }
  </code></pre>
  
  <p>The exception is thrown in container.AddFacility() call.</p>
  
  <p>Below is the list of Castle Windsor and NHibernate assembly versions currently referenced in the projects:</p>
  
  <ul>
  <li>Castle.Core 3.3.0 </li>
  <li>Castle.Windsor 3.3.0 </li>
  <li>Castle.Facilities.NHibernateIntegration 1.1.0.39</li>
  <li>Castle.Services.Transaction 2.5.0.0</li>
  <li>NHibernate 3.1.0.4000</li>
  <li>FluentNHibernate 2.0.0.0</li>
  <li>Iesi.Collections 2.1.0.4000</li>
  </ul>
  
  <p>What version of Castle Windsor is compatible with NHibernate Integration Facility? Is there a patch available that I can download to resolve this issue?</p>
  
  <p>I found a similar question on stackoverflow and an issue was logged on the projects tracker for a resolution. But this was Castle Windsor version 3.0 way back in Dec 2011, see the link below. </p>
  
  <p><a href="https://stackoverflow.com/questions/8557327/castle-windsor-3-fluent-nhibernate-castle-nhibernate-integration">Castle Windsor 3 + Fluent NHibernate + Castle.NHibernate.Integration</a></p>
  
  <p>Did the fix not make it in Castle.Core 3.3.0?</p>
  
  <p>Or am I missing something here, any help / suggestion greatyl appreciated.</p>
  
  <p>Thanks</p>