Create your class derived from IHttpHandler:
public class MyHttpHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.BufferOutput = false;
// always create log file outside of the \bin folder if hosted in IIS\ASP.NET.
FileLogger.LogFile = context.Request.PhysicalApplicationPath + "WebDAVlog.txt";
WDEngine engine = new WDEngine();
engine.Run(HttpContext.Current);
}
}
Make sure your log file is created outside of the \bin folder. If your logfile will be created in a \bin folder, your server will restart each time the logfile is updated, recycling application and session state.