Code inspection: Event never invoked
This inspection reports an event that can be subscribed to but is never raised. That usually means the event is incomplete, dead code, or does not notify listeners as intended.
Example
class Counter
{
public event EventHandler? Changed;
public void Subscribe(EventHandler handler)
{
Changed += handler;
}
}
class Counter
{
public event EventHandler? Changed;
public void Increment()
{
Changed?.Invoke(this, EventArgs.Empty);
}
}
Quick-fix
There is no dedicated quick-fix for this inspection. A typical correction is to raise the event where the state actually changes, or remove the event if it is not needed.
01 April 2026