0

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

Tig7r
  • 525
  • 1
  • 4
  • 21

1 Answers1

1

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.

Michael Tobisch
  • 1,034
  • 6
  • 15
  • It seems to work in 9.11 - just tried it with the EventLogger in my BusinessController class, that seems to work, at least there was no compiler error or deprecated warning anymore. See [The dreaded "Deprecated" and "Obsolete"](https://github.com/dnnsoftware/Dnn.Platform/discussions/4091) – Michael Tobisch Dec 07 '22 at 14:59