I am being prompted for a file called EnumerableExtensions.cs when using the NHibernateFacility for Castle Windsor. I have replicated this with the following steps (all packages were installed from NuGet):
- Create a new WPF project
- Install Castle.Core 3.1.0
- Install Castle.Windsor 3.1.0
- Install Castle.FactorySupportFacility 3.1.0
- Install Castle.Transactions 3.2.207.2207
- Install Castle.Facilities.AutoTx 3.2.207.2207
- Install NHibernate 3.3.1.4000
- Install Fluent NHibernate 1.3.0.733
- Install Castle.Facilities.NHibernate 0.7.1.23602
Override OnStartup() in App.xaml.cs to create the Windsor container and add the facilities to it. See code below.
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); IWindsorContainer container = new WindsorContainer(); container.AddFacility<AutoTxFacility>(); container.Register( Component.For<INHibernateInstaller>() .ImplementedBy<FluentNHibernateInstaller>()); container.AddFacility<NHibernateFacility>(); }
This is the code in FluentNHibernateInstaller.cs
public class FluentNHibernateInstaller : INHibernateInstaller
{
public FluentConfiguration BuildFluent()
{
return Fluently.Configure();
}
private IPersistenceConfigurer SetupDatabase()
{
return MsSqlConfiguration.MsSql2008
.ConnectionString(c => c
.Server("Server")
.Database("Database")
.Username("User")
.Password("Password"));
}
public Maybe<NHibernate.IInterceptor> Interceptor
{
get { return Maybe.None<NHibernate.IInterceptor>(); }
}
public bool IsDefault
{
get { return true; }
}
public void Registered(ISessionFactory factory)
{
}
public string SessionFactoryKey
{
get { return "sf.default"; }
}
}
When I run the application, this is the dialog I am presented with:
To me this looks like something is wrong with the DLL but when I posted about this on the Castle Project Google Group it was suggested that I had incompatible versions of Windsor in my app. Is this true or does it seem like something else is going on?