I'm creating an Api and I am also using mediatR, I have created my commands, queries, handlers, but when I try to launch my Api I get this error message in my program class:
Could not load type 'MediatR.ServiceFactory' from assembly 'MediatR, Version=12.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2'.
I'm registering my mediatR in my program class like this:
builder.Services.AddMediatR(Assembly.GetExecutingAssembly());
I have installed the MediatR (latest version: 12.0.0) and the MediatR.Extensions.Microsoft.DependencyInjection (version: 11.0.0 ) because the latest version(11.1.0) at this moment is deprecated.
I'm using .Net 6, any possible solution? thanks in advance.