I am trying to replace all the Deprecated EventLoggerController code in my DotNetNuke (DNN) Modules.
I had a look at an answer someone posted on a previous question I had and also another question asked by someone.
- DNN 9.8 - EventLogController is obsolete - Does anyone have an example on how to use the Dependency Injection method to fix this error?
- Why am I getting the error "Cannot instantiate implementation type" for my generic service?
I also had a look at this article regarding DNN webforms using Dependency Injection: https://www.andrewhoefling.com/Blog/Post/dnn-dependency-injection-webforms-modules
I am getting the following error:
I have added a Startup.cs file to my DNN module project:
I have added the following code to my code behind file:
private readonly IEventLogger _eventLogger;
public View()
{
_eventLogger = DependencyProvider.GetRequiredService<IEventLogger>();
}
I assume something is wrong with my Startup.cs file.