rebus-org / Rebus.SimpleInjector

:bus: SimpleInjector container adapter for Rebus
https://mookid.dk/category/rebus
Other
5 stars 6 forks source link

Error using Rebus.SimpleInjector 6.0.0 "System.MissingFieldException: Field not found: 'SimpleInjector.Lifestyle.Singleton'" #9

Closed danilobreda closed 4 years ago

danilobreda commented 4 years ago

Im having problem when executing this code after upgrating to latest versions (Rebus and SimpleInjector)

public static void ConfigureMockBus(this SimpleInjector.Container container)
        {
            //configurando rebus
            container.ConfigureRebus((conf) =>
            {
                var config = conf.Transport(t => t.UseInMemoryTransport(new InMemNetwork(), "test"));
                return config.Start();
            });
        }

Message: Test method SharedKernel.Tests.Rebus.RebusConfigurationExtensionTest.ConfigureMockBus_Test threw exception: System.MissingFieldException: Field not found: 'SimpleInjector.Lifestyle.Singleton'. Stack Trace: SimpleInjectorConfigurationExtensions.ConfigureRebus(Container container, Func2 configurationCallback) RebusConfigurationExtension.ConfigureMockBus(Container container, Boolean useSaga, Action1 routeConfigurer) line 44 RebusConfigurationExtensionTest.ConfigureMockBus_Test() line 23

image

danilobreda commented 4 years ago

With simpleinjector 4.10.2 works!

mookid8000 commented 4 years ago

You should be able to update to Rebus.SimpleInjector 7.0.0, which has been updated to work with SimpleInjector 5 🙂