{"record":{"id":"f701448a391d53fb","repo":"aspnetboilerplate/aspnetboilerplate","slug":"given-target-notifier-is-not-registered-before-t","errorCode":null,"errorMessage":"Given target notifier is not registered before: {targetNotifier.FullName} You must register it to the INotificationConfiguration.Notifiers!","messagePattern":"Given target notifier is not registered before: (.+?) You must register it to the INotificationConfiguration\\.Notifiers!","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"src/Abp/Notifications/NotificationPublisher.cs","lineNumber":136,"sourceCode":"                \n                await uow.CompleteAsync();\n            }\n        }\n\n        protected virtual void SetTargetNotifiers(NotificationInfo notificationInfo, Type[] targetNotifiers)\n        {\n            if (targetNotifiers == null)\n            {\n                return;\n            }\n            \n            var allNotificationNotifiers = _notificationConfiguration.Notifiers.Select(notifier => notifier.FullName).ToList();\n                    \n            foreach (var targetNotifier in targetNotifiers)\n            {\n                if (!allNotificationNotifiers.Contains(targetNotifier.FullName))\n                {\n                    throw new ApplicationException(\"Given target notifier is not registered before: \" + targetNotifier.FullName+\" You must register it to the INotificationConfiguration.Notifiers!\");\n                }\n            }\n\n            notificationInfo.SetTargetNotifiers(targetNotifiers.Select(n => n.FullName).ToList());\n        }\n\n        /// <summary>\n        /// Gets the string for <see cref=\"NotificationInfo.TenantIds\"/>.\n        /// </summary>\n        /// <param name=\"tenantIds\"></param>\n        /// <seealso cref=\"DefaultNotificationDistributer.GetTenantIds\"/>\n        private static string GetTenantIdsAsStr(int?[] tenantIds)\n        {\n            if (tenantIds.IsNullOrEmpty())\n            {\n                return null;\n            }\n","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/aspnetboilerplate/aspnetboilerplate/blob/2323c13a152aa0ebfb37af3830f687d7f5b53795/src/Abp/Notifications/NotificationPublisher.cs#L118-L154","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Register the notifier in PreInitialize: Configuration.Notifications.Notifiers.Add<MyNotifier>()","Ensure the module containing the registration is loaded in the application/process doing the publishing","Verify the exact type passed to targetNotifiers matches the registered type's FullName"],"exampleFix":"// before\nawait publisher.PublishAsync(name, ..., targetNotifiers: new[] { typeof(MyNotifier) }); // never registered\n// after\npublic override void PreInitialize()\n{\n    Configuration.Notifications.Notifiers.Add<MyNotifier>();\n}\nawait publisher.PublishAsync(name, ..., targetNotifiers: new[] { typeof(MyNotifier) });","handlingStrategy":"validation","validationCode":"var registered = _notificationConfiguration.Notifiers.Select(n => n.FullName);\nif (targetNotifiers.Any(t => !registered.Contains(t.FullName))) throw new InvalidOperationException(\"Register all target notifiers in Configuration.Notifications.Notifiers\");","typeGuard":null,"tryCatchPattern":"try { await publisher.PublishAsync(name, ..., targetNotifiers); } catch (ApplicationException ex) { log.LogError(ex, \"Target notifier not registered\"); throw; }","preventionTips":["Register every notifier in PreInitialize via Configuration.Notifications.Notifiers.Add<T>()","Keep notifier registration in a module loaded by every host that publishes notifications","Define the targetNotifiers array from the same type references used at registration"],"tags":["not-registered","notifications","config","dependency"],"backgroundTag":"missing-dependency","analyzedSha":"2323c13a152aa0ebfb37af3830f687d7f5b53795","analyzedAt":"2026-09-08T08:00:50.638Z","contentChangedAt":"2026-09-08T08:00:50.638Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}