views:

128

answers:

1

Hi

I'm trying to get custom HttpHandler working in my sample web application. I've been experiencing a lot of issues, but finally got stuck with error 500. Application pool is being run in Classic ASP.NET 2.0 mode. Server is IIS 7.5, OS is Win 7 Pro.

Here's a code of my handler:

public class SampleHandler : IHttpHandler
{
    public SampleHandler()
    {

    }

    public bool IsReusable 
    {
        get 
        {
            return true;
        }
    }

    public void ProcessRequest(HttpContext context) 
    {
        context.Response.Clear();
        context.Response.ContentType = "text/html";
        context.Response.Write("This is a sample content.");
        context.Response.Expires = 0;
        context.Response.End();
    }
}

Here is a web.config file content:

<?xml version="1.0"?>

<configuration>
  <system.web>
    <httpHandlers>
      <add verb="*" path="*.shc" type="SampleHandler"/>
    </httpHandlers>
  </system.web>
  <system.webServer>
    <handlers>
      <add resourceType="Unspecified" verb="*" path="*.shc" name="SampleHandler" type="SampleHandler" modules="IsapiModule" scriptProcessor="c:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll\aspnet_isapi.dll"/>
    </handlers>
  </system.webServer>
</configuration>

Here is a link to the screenshot of an error : http://bit.ly/cmPk4i

Could anybody please tell me what I did wrong? Thanks in advance!

A: 

From the list of "things you can try", did you install the .Net Extensibility Feature?

You can also enable the Failed Requests logging feature on the application, which provides detailed information on request processing.

The good news, at least, is that your registered handler is recognized as the handler to be executed.

devio
Thank you very much for your response, I've already figured out what was wrong (it was a mistake which is not worth considering it here).
the_V