I originally posted this in the thread about the Castle.Transactions 3.1 
announcement 
thread<https://groups.google.com/forum/?fromgroups=#!topic/castle-project-users/CLHTeZRy7qM>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:

<https://lh5.googleusercontent.com/-uUKzqz1wWj4/UFX8d9FIGvI/AAAAAAAAABE/tpvdWu2cJH8/s1600/EnumerableExtensions.PNG>

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?

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/castle-project-users/-/9goLVC_h8I0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to