Missing handler only in kubernetes
The project that I'm experiencing this with can be found here: https://gitlab.com/letskeepitcheap/worker
I get the following error Error constructing handler for request of type MediatR.IRequestHandler`2[Worker.GetDueTransactionsQuery,System.Collections.Generic.IEnumerable`1[Worker.LedgerEntry]]. Register your handlers with the container. See the samples in GitHub for examples. for one of the two BackgroundServices.
I run a little kubernetes cluster on a VM for running some of my code, and this exception only occurs when this application is run in the cluster. I don't get the error when I run the exact same code locally (via command line) nor if I build the container and run it on my personal computer (and everything executes as I'd expect).
Let me know if I should provide more information.
I don't have time to dog into the MediatR code right now; I might try to figure this out later if I have time, though.
Have you been able to resolve this now?
I have the same problem. I still couldn't solve
It might be due to this bug in the .NET Core DI library:
https://github.com/dotnet/runtime/issues/65145
You can verify locally in the steps in that issue.
It might be due to this bug in the .NET Core DI library:
You can verify locally in the steps in that issue.
Thank you for reply.
Not my case, I use the repository in command hadler, and in docker I have to pass the database service name defined in docker-compose. I was passing localhost instead of "mssql" for example. This was interfering with mediatR service registry.
Work's now.