aspnetboilerplate/aspnetboilerplate · error · ApplicationException

Given target notifier is not registered before

Error message

Given target notifier is not registered before: {targetNotifier.FullName} You must register it to the INotificationConfiguration.Notifiers!

What it means

When targetNotifiers are supplied, SetTargetNotifiers checks each notifier type against the list registered in INotificationConfiguration.Notifiers. If a requested notifier type was never registered, it throws ApplicationException because the publisher cannot resolve it at distribution time.

Solutions

  1. Register the notifier in PreInitialize: Configuration.Notifications.Notifiers.Add<MyNotifier>()
  2. Ensure the module containing the registration is loaded in the application/process doing the publishing
  3. Verify the exact type passed to targetNotifiers matches the registered type's FullName

Example fix

// before
await publisher.PublishAsync(name, ..., targetNotifiers: new[] { typeof(MyNotifier) }); // never registered
// after
public override void PreInitialize()
{
    Configuration.Notifications.Notifiers.Add<MyNotifier>();
}
await publisher.PublishAsync(name, ..., targetNotifiers: new[] { typeof(MyNotifier) });
Defensive patterns

Strategy: validation

Validate before calling

var registered = _notificationConfiguration.Notifiers.Select(n => n.FullName);
if (targetNotifiers.Any(t => !registered.Contains(t.FullName))) throw new InvalidOperationException("Register all target notifiers in Configuration.Notifications.Notifiers");

Try / catch

try { await publisher.PublishAsync(name, ..., targetNotifiers); } catch (ApplicationException ex) { log.LogError(ex, "Target notifier not registered"); throw; }

Prevention

When it happens

Trigger: Calling PublishAsync(name, ..., targetNotifiers: new[] { typeof(MyNotifier) }) where MyNotifier was never added via Configuration.Notifications.Notifiers.Add<MyNotifier>() in module PreInitialize; renaming/moving the notifier class so a different type is passed.

Common situations: Adding a custom realtime/email notifier but forgetting registration; notifier registered in a module that is not loaded in the environment (e.g. only registered in the Web module, publishing from a background job); namespace/type mix-ups with similarly named classes.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of aspnetboilerplate/aspnetboilerplate@2323c13a15 (2026-09-08). Data as JSON: /api/errors/f701448a391d53fb. Report an issue: GitHub.

Appendix: source

Thrown at src/Abp/Notifications/NotificationPublisher.cs:136

                
                await uow.CompleteAsync();
            }
        }

        protected virtual void SetTargetNotifiers(NotificationInfo notificationInfo, Type[] targetNotifiers)
        {
            if (targetNotifiers == null)
            {
                return;
            }
            
            var allNotificationNotifiers = _notificationConfiguration.Notifiers.Select(notifier => notifier.FullName).ToList();
                    
            foreach (var targetNotifier in targetNotifiers)
            {
                if (!allNotificationNotifiers.Contains(targetNotifier.FullName))
                {
                    throw new ApplicationException("Given target notifier is not registered before: " + targetNotifier.FullName+" You must register it to the INotificationConfiguration.Notifiers!");
                }
            }

            notificationInfo.SetTargetNotifiers(targetNotifiers.Select(n => n.FullName).ToList());
        }

        /// <summary>
        /// Gets the string for <see cref="NotificationInfo.TenantIds"/>.
        /// </summary>
        /// <param name="tenantIds"></param>
        /// <seealso cref="DefaultNotificationDistributer.GetTenantIds"/>
        private static string GetTenantIdsAsStr(int?[] tenantIds)
        {
            if (tenantIds.IsNullOrEmpty())
            {
                return null;
            }

View on GitHub (pinned to 2323c13a15)