event-handlingdotnetnukednn9

How to add the new Event Logger to a DNN Scheduler Class in DNN 9.10.2?


How can I add a constructor with a reference to _eventLogger = DependencyProvider.GetRequiredService(); in a DNN Scheduler class?

The Dependency Provider can be inherited through the PortalModuleBase class, which I can do on my current Web Form module. The issue is that it is Protected and I can't inherit it again on the same View.ascx page in a Scheduler Class.

enter image description here


Solution

  • It is the same problem as in this post. Dependency injection in DNN is not (yet) available in Scheduler classes, only in webforms code-behind.