Jim Aho
Jim Aho

Reputation: 11887

Plugging in your own IoC container in NServiceBus 4

It seems that in version 5 of NServiceBus the API allows you to inject an instance of your own IoC container into NServiceBus with the following syntax:

configuration.UseContainer<UnityBuilder>(c => c.UseExistingContainer(unityContainer));

The only mentioned syntax for version 4 is as follows:

  Configure.With().UsingContainer<UnityObjectBuilder>();

Is it correct that you cannot inject an instance of your own container in version 4 of NServiceBus? I.e. you can only tell NServiceBus to use another container, but not yours specifically.

Upvotes: 3

Views: 207

Answers (1)

Phil Sandler
Phil Sandler

Reputation: 28016

Yes, that's supported. The syntax is:

Configure.With().UnityBuilder(container);

Upvotes: 3

Related Questions