workflow-core icon indicating copy to clipboard operation
workflow-core copied to clipboard

Using MySQL prompts no context

Open xuguilins opened this issue 3 years ago • 2 comments

Describe the bug my system: mac os using pack: WorkflowCore.Persistence.MySQL / Workflow.Core framework: net6.0 error Message:
No database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.

To Reproduce ex: string connectionString = builder.Configuration.GetConnectionString("Conection"); builder.Services.AddWorkflow(options => { options.UseMySQL(connectionString, false, false); }); builder.Services.AddControllers(); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); var host = app.Services.GetService<IWorkflowHost>(); host.RegisterWorkflow<LeaveWorkFlowApp,LeveManager>(); host.Start();

xuguilins avatar Jul 13 '22 01:07 xuguilins

I have the same problem!

blance1024 avatar Jul 27 '22 02:07 blance1024

@xuguilins WorkflowCore. Persistence. MySQL version 3.6.2 can normal use.

blance1024 avatar Jul 27 '22 06:07 blance1024

There was an error when using MySql persistence version 3.6.3 with .NET 6.

Update WorkflowCore. Persistence. MySQL to 3.6.4 or 3.6.5 .

lfbertucci avatar Aug 19 '22 16:08 lfbertucci

@blance1024 I'm sorry I only read the news now, I solved this problem later

xuguilins avatar Aug 20 '22 02:08 xuguilins