elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.52k stars 1.2k forks source link

Elsa conflict with Mediatr #2803

Closed ZoranMaricic closed 2 years ago

ZoranMaricic commented 2 years ago

This is my code in Program.cs:

var elsaSection = builder.Configuration.GetSection("Elsa");
// Elsa services.
builder.Services.AddElsa(elsa => elsa
    .UseEntityFrameworkPersistence(ef => ef.UseSqlServer(builder.Configuration.GetConnectionString("Database")))
    .AddConsoleActivities()
    .AddHttpActivities(elsaSection.GetSection("Server").Bind)
    .AddQuartzTemporalActivities()
    .AddWorkflowsFrom<Program>()
);
//Elsa API endpoints.
builder.Services.AddElsaApiEndpoints();

// Allow arbitrary client browser apps to access the API.
// In a production environment, make sure to allow only origins you trust.
builder.Services.AddCors(cors => cors.AddDefaultPolicy(policy => policy
    .AllowAnyHeader()
    .AllowAnyMethod()
    .AllowAnyOrigin()
    .WithExposedHeaders("Content-Disposition"))
);

After I start the project I get an error in runtime that says: System.TypeLoadException: 'Could not load type 'MediatR.INotification' from assembly 'MediatR, Version=10.0.0.0

sfmskywalker commented 2 years ago

Probably one of your projects is referencing a different version of Mediatr compared to what Elsa is referencing, or perhaps one or more projects are referencing different versions of Elsa.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.