Closed ghost closed 4 years ago
Hi @djary,
Thank you for posting this issue. You're actually deviating from the tutorial, in the tutorial it shows how to use events with a class
. Instead, you're attempting to use an interface
with a default method implementation. This happens when using a default method implementation with an interface
. If you change from an interface
to a class
, like demonstrated in the tutorial this will work. As of right now, accessing event members in default interface methods is not supported.
More information on this here, and more specifically.
gafter commented on Nov 4, 2019 This is by design. Your event is abstract. As such it has no backing field or implementation. There is no value for you to invoke.
I'm using dot net standard 2.1 and c# 8, I want to create an event for my class (interface), I follow this tutorial and I wrote an interface:
but take me an error:
I proceeded with this training, so where is the problem? stackoverflow link