-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not load type Mediatr.IRequest #692
Comments
Same issue for me with an AspNet.Core 6.0 app
|
I've got it running on .NET 6, is there a repro? Are you using the DI package? |
And the exception message is correct - those types are in a separate MediatR.Contracts assembly as mentioned in the release notes. But user code shouldn't care about that in scenarios I looked at. |
txs for coming back. Sadly, I can't send you the project cause it's a customer code. |
@jbogard I'm using .Net5. I'm not using the DI package (I only have Mediatr package installed) |
If you check your stack trace, do you have code looking for the |
@jbogard I don't see that in the stacktrade. However, I have the issue in multiple projects. I tried to force the update by install Mediatr10 in the project itself but I have the same issue. |
I don't know how to fix this without a minimal repro. I can only share that those request types are in a separate package/assembly - |
Note that I have the same issue, but it happens when calling Nobody mentions here what triggers the exception, so maybe we all have the same issue (with different external libs) ? In my case, the exception happen on the second line.
Removing it fixes the issue. I have a very stripped down version of my project with the issue, but if the issue is in another lib, not sure this would be useful. Edit : my issue was fixed by the update of the external lib. |
I'm using dotnet 6 a had to drop to MediatR 8.1 and MediatR.Extensions.Microsoft.DependencyInjection 8.1 to solve this. |
@jbogard Also coming across this CS7069. My scenario: I think that's your repro there. At least it sounds reasonable. |
Hi, Downgrading the solution to MediatR 9 resolve the issue for me. |
The assemblies were split out and This is pretty normal for major versions, you can't mix major versions of assemblies without expecting some failures. |
Hi, I just opened a pull request that should solve the issue described here. See #800. I understand that major upgrades contain breaking changes, however this one is particularly hard to solve for us. We have tens of contracts packages that are currently referring to MediatR 8.1 (where the interfaces for request types were living until then), and those are consumed by many services. We cannot afford upgrading everything at once. I think the proposed change will allow upgrading a service to the latest MediatR version while still referencing contract packages that consume MediatR 8.1 (provided of course there are no other breaking changes than this one that affect the code base). Thx |
Fixed by #800 |
I solved the problem by downgrading from mediatr 11.10 t0 11.0 |
Hi,
Since update to Mediatr 10, I have the following error at runtime:
Could not load type 'MediatR.IRequest 1' from assembly 'MediatR, Version=10.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2'
Any idea what's going on ?
The text was updated successfully, but these errors were encountered: