ademclk / ceyehat-api

My senior project, backend.
MIT License
7 stars 0 forks source link

Unhandled exception. System.TypeLoadException: Could not load type 'MediatR.ServiceFactory' from assembly 'MediatR, Version=12.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2'. #64

Closed ademclk closed 1 year ago

ademclk commented 1 year ago

Updated my MediatR to 12.0.0.0 now application isn't working. This issue already created at MediatR repository, too.

Error

/usr/local/share/dotnet/dotnet /Users/ademclk/RiderProjects/ceyehat-api/ceyehat/bin/Debug/net7.0/ceyehat.dll
Unhandled exception. System.TypeLoadException: Could not load type 'MediatR.ServiceFactory' from assembly 'MediatR, Version=12.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2'.
   at MediatR.Registration.ServiceRegistrar.AddRequiredServices(IServiceCollection services, MediatRServiceConfiguration serviceConfiguration)
   at MediatR.ServiceCollectionExtensions.AddMediatR(IServiceCollection services, IEnumerable`1 assemblies, Action`1 configuration)
   at MediatR.ServiceCollectionExtensions.AddMediatR(IServiceCollection services, Assembly[] assemblies)
   at Ceyehat.Application.DependencyInjection.AddApplication(IServiceCollection services) in /Users/ademclk/RiderProjects/ceyehat-api/Ceyehat.Application/DependencyInjection.cs:line 12
   at Program.<Main>$(String[] args) in /Users/ademclk/RiderProjects/ceyehat-api/ceyehat/Program.cs:line 10

Process finished with exit code 134.

This line causes the error

services.AddMediatR(typeof(DependencyInjection).Assembly);