views:

12

answers:

1

I am trying to implement an IHttpHandler. I have defined an appropriate class but the debug web server (you know, the one you get if you hit f5 in Visual Studio) is responding with "Can't Display Page".

I looked here http://msdn.microsoft.com/en-us/library/ms228090%28v=VS.90%29.aspx to learn how to configure the handler, and it seems there are different ways for IIS6 and 7. But the process is put something in the web.config and then set it up in IIS Manager. However, that is a deployment issue. I want to be able to run it in the test server, and I don't know how to do this second step in the test server.

I put the following in my web.config:

<httpHandlers>
  <add verb="*" path="*.sample"
    type="MyNamespace.Code.HelloWorldHandler"/>
</httpHandlers>

HelloWorldHandler is the code from the link above (wrapped in MyNamespace.)

Can someone let me know how to configure this correctly for the development server?

A: 

You should be able to set the web server settings via web.config like this...

<configuration>
  <system.webServer>
    <handlers>
      <add name="HelloWorldHandler"
           verb="*"
           path="*.sample" 
           type="MyNamespace.Code.HelloWorldHandler"
           resourceType="Unspecified" />
    <handlers>
  </system.webServer>
</configuration>
Josh Stodola