'System.ObsoleteAttribute' cannot be applied to the 'AddHandler', 'RemoveHandler', or 'RaiseEvent' definitions
'System.ObsoleteAttribute' cannot be applied to the 'AddHandler', 'RemoveHandler', or 'RaiseEvent' definitions. If required, apply the attribute directly to the event.
A custom event applies the ObsoleteAttribute to its AddHandler
, RemoveHandler
, or RaiseEvent
procedure.
The ObsoleteAttribute marks a programming element as no longer in use and informs users that the element is to be removed in future versions of the product.
It is not meaningful to have certain parts of a custom event still in use while others are no longer in use.
Error ID: BC31142
To correct this error
- Remove the ObsoleteAttribute from the individual procedure declaration and apply it to the overall event declaration.
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for