Prompted for EnumerableExtensions.cs using Castle.Facilities.NHibernateFacility

8 views
Skip to first unread message

Stu

unread,
Sep 29, 2012, 10:41:12 AM9/29/12
to castle-pro...@googlegroups.com
I originally posted this in the thread about the Castle.Transactions 3.1 announcement thread but it hasn't got much visibility in there so I decided to post a separate thread.

  1. Create a new WPF project
  2. Install Castle.Core 3.1.0
  3. Install Castle.Windsor 3.1.0
  4. Install Castle.FactorySupportFacility 3.1.0
  5. Install Castle.Transactions 3.2.207.2207
  6. Install Castle.Facilities.AutoTx 3.2.207.2207
  7. Install NHibernate 3.3.1.4000
  8. Install Fluent NHibernate 1.3.0.733
  9. Install Castle.Facilities.NHibernate 0.7.1.23602
  10. 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 in the other thread 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?

Reply all
Reply to author
Forward
0 new messages