Mediator icon indicating copy to clipboard operation
Mediator copied to clipboard

Notification handler open generic doesn't work

Open rignatev opened this issue 2 years ago • 1 comments

Hi! I was testing the notification handlers and found a problem. When I use a notification handler open generic it doesn't work. Another notification handler is called twice instead.

Example code https://github.com/rignatev/MediatorSandbox.

Did I miss something?

rignatev avatar Jul 03 '23 21:07 rignatev

Hmm this is a weird one...

code:

var svc = app.Services.GetServices<global::Mediator.INotificationHandler<global::MediatorSandbox.App.TestNotification>>().ToArray();

.NET 7: image

.NET 8 preview 7: image

Is there a bug in DI for .NET 7 that I've missed? The DI registration code looks correct as far as I can tell

martinothamar avatar Aug 21 '23 16:08 martinothamar

I think this was a .NET bug actually. I have not seen this since. Closing for now

martinothamar avatar May 03 '25 14:05 martinothamar