0

I get an error as below while I persist states with EntityFramework

MT-Reason: fault

MT-Fault-Message: Method not found: 'System.Threading.Tasks.Task`1 Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlCommandAsync(Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade, System.String, System.Threading.CancellationToken, System.Object[])'.

MT-Fault-StackTrace: at MassTransit.EntityFrameworkCoreIntegration.Saga.EntityFrameworkSagaRepository1.d__81.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at MassTransit.EntityFrameworkCoreIntegration.Saga.EntityFrameworkSagaRepository1.SendQuery[T](SagaQueryConsumeContext2 context, ISagaPolicy2 policy, IPipe1 next) at MassTransit.Saga.Pipeline.Filters.QuerySagaFilter2.>-Send>d__6.MoveNext() at MassTransit.Saga.Pipeline.Filters.QuerySagaFilter2.-Send>d__6.MoveNext() at GreenPipes.Filters.TeeFilter1.d__5.MoveNext() at GreenPipes.Filters.OutputPipeFilter2.d__6.MoveNext() at GreenPipes.Filters.OutputPipeFilter2.-Send>d__6.MoveNext() at MassTransit.Pipeline.Filters.DeserializeFilter.d__4.MoveNext() at GreenPipes.Filters.RescueFilter2.d__5.MoveNext()

All my tests are passing and state machine is working with InMemorySagaRepository. But when I change it to EntityFrameworkSagaRepository, it has difficulties to store and throwing above error. Any suggestions?

Alexey Zimarev
  • 17,944
  • 2
  • 55
  • 83
JasKevs
  • 9
  • 1
  • 3
  • Looks like dll version issue. – Alexey Zimarev Aug 07 '17 at 07:40
  • The error message says that you are not able to find `ExecuteSqlCommandAsync` method with given parameters from `EFSagaRepository` check your repository and make sure you are trying to find correct method based on EF version you are using. This wouldn't throw during InMemory since ExecuteSql doesn't exist for in memory – Smit Aug 07 '17 at 22:46
  • @AlexeyZimarev I don't think so, removed and updated all dll's to latest versions – JasKevs Aug 07 '17 at 23:48
  • @JasKevs to latest versions of what? The missing method seems to be in the EF dll. Probably you use too new EF version? MT has no upper limit in nuspec so this can happen. – Alexey Zimarev Aug 08 '17 at 07:28

0 Answers0