danielcirket / OpenEventSourcing

MIT License
3 stars 0 forks source link

NETCore 3.0 Service Provider Validation Failures #15

Closed AtLeastITry closed 4 years ago

AtLeastITry commented 4 years ago

When using the OpenEventSourcing.EntityFrameworkCore package, .Net core 3 throws a runtime error complaining about the OpenEventSourcingDbContext. see: https://github.com/sound-it-out/sio-api/tree/feature/core3.0-upgrade

Error Message: OpenEventSourcing.EntityFrameworkCore.DbContexts.OpenEventSourcingDbContext Lifetime: Scoped ImplementationType: OpenEventSourcing.EntityFrameworkCore.DbContexts.OpenEventSourcingDbContext': A suitable constructor for type 'OpenEventSourcing.EntityFrameworkCore.DbContexts.OpenEventSourcingDbContext' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.

Inner Exception:
A suitable constructor for type 'OpenEventSourcing.EntityFrameworkCore.DbContexts.OpenEventSourcingDbContext' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.

danielcirket commented 4 years ago

This is due to the new service validation that runs in development mode on startup.

You're getting 11 different cases of this, mostly around the IEventBus not having a registered implementation.

With the version that you're using currently does not include the AddAzureServiceBus(...) extension method to register the AzureServiceBus implementation (see PR #6).

There are 2 cases for each of the DbContexts, so will investigate those in the mean time.