开发者

Configure IHttpHandler in the Test Web Server

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 developme开发者_如何转开发nt server?


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜