Thanks to Andreas Öhlund for spotting an issue with the original
version - this updated patch will work with the NHibernate saga
persister and other components which were not targeted with the first
release. The usage remains the same as my initial post below, and a
new version of the build/merge batch scripts are included.
Thanks,
Matt
On Thu, Mar 5, 2009 at 12:29 PM, Matt Burton <matt.burton@...> wrote:
> In case anyone needs it prior to nServiceBus 2.0, here is a patch to
> enable Autofac support today. Here's a quick example:
>
> var builder = new ContainerBuilder();
>
> //saga persistence
>
builder.Register<InMemorySagaPersister>().As<ISagaPersister>().SingletonScoped()\
;
>
> IContainer container = builder.Build();
>
> Configure.With()
> .AutofacBuilder(container)
> .MsmqSubscriptionStorage()
> .Sagas()
> .XmlSerializer()
> .MsmqTransport()
> .IsTransactional(true)
> .PurgeOnStartup(false)
> .UnicastBus()
> .ImpersonateSender(false)
> .LoadMessageHandlers()
> .CreateBus()
> .Start();
>
> Version 1.4.x of Autofac is a requirement, and downloads can be found here:
>
> http://code.google.com/p/autofac/downloads/list
>
> A direct link at the time of this writing would be:
>
> http://autofac.googlecode.com/files/autofac-1.4.1.487.zip
>
> I've also included Autofac-specific build/merge batch files which
> creates a merged version of NSB that is Autofac-specific, in case that
> helps.
>
> Thanks,
> Matt
>