views:

6

answers:

1

This is the error: Precondition failed.: !IsConfigured Cannot configure the environment when it is already configured.

public static void BootUp()
    {
        var config = new StructureMapConfiguration((i) =>
        {
            i.For<ICommandService>().Use(InitializeCommandService());
            i.For<IEventStore>().Use(InitializeEventStore());
            i.For<IEventBus>().Use(InitializeEventBus());
        });

        NcqrsEnvironment.Configure(config);
    }

I have troubles when I tried to add new data, it allows me to create just one customer, but if I tried to add the seconde it fails:

NcqrsEnvironment.Configure(config);

Im using Ncqrs.

A: 
 if (!NcqrsEnvironment.IsConfigured)
                NcqrsEnvironment.Configure(config);

You should add the line tho check if it is already configured and if it is not, then should configure it.

Cucu and Allan