I have a simple handler written in c# with IHttpHandler.How can I make it work on IIS? I followed the tutorial in http://mvolo.com/developing-iis7-modules-and-handlers-with-the-net-framework/#handler but it didn't work for me.
In IIS7 my steps :
I create a new webpage called "SAMPLE"
From HandleMappings I pressed "Add Managed Handler"
I fill the columns -> Request path : *.tm Type : SampleServer.MyHandler Name : MyHandler
Try to open localhost/SampleServer.tm/
I received this error : invalid "ManagedPipelineHandler" module in MyHandler Module List. Error Code : 0x8007000d
Web.сonfig File Generated automatically :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="MyHandler" path="*.tm" verb="*" type="SampleServer.MyHandler" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>
</configuration>
My handler.cs file :
namespace SampleServer
{
class MyHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
DateTime dt = DateTime.Now;
context.Response.Write(String.Format("<h1>{0}</h1>", dt.ToLongTimeString()));
}
}
}