I am learning to develop about creating a module for IIS to be use by web application. When I add my .dll to the /bin folder of web application that is hosted in IIS, it works.
But if I add this .dll to the root local server > Modules > Configure Native Modules and Register. It didn't work, when I run a web app the AppPool being use is stopped, the logs I'm seeing from the eventviewer is this:
Failed to find the RegisterModule entrypoint in the module DLL %windir%\TestWebAgent\x86\TestModule.dll. The data is the error.
This is my class that extends IHttpModule:
using System;
using System.Web;
namespace MyTestModule
{
public class TestModule : IHttpModule
{
public void Dispose()
{
throw new NotImplementedException();
}
public void Init(HttpApplication application)
{
application.BeginRequest += (new EventHandler(this.Application_BeginRequest));
}
private void Application_BeginRequest(Object source, EventArgs e)
{
HttpApplication application = (HttpApplication)source;
HttpContext context = application.Context;
context.Response.Write("<h1><font color=green>AUTHENTICATED</font></h1><hr>");
}
}
}