为什么我的IHttpHandler被称为?

编程入门 行业动态 更新时间:2024-10-10 12:21:10
本文介绍了为什么我的IHttpHandler被称为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图让一个自定义的处理程序,以对特定URL的工作(或一组网址)的ASP.NET 3.5。

I'm trying to get a custom handler to work for a specific URL (or set of URLs) in ASP.NET 3.5.

该处理程序实际上并没有做任何显著的是 - 它只是记录的请求。我可以张贴code,如果任何人的东西是相关的,但我真的不认为它被称为可言。 (特别是,对于正常的例外,我得到一个自定义错误页和记录......在这里我只是得到香草IIS 404)。

The handler doesn't actually do anything significant yet - it just logs the request. I can post the code if anyone things it's relevant, but I really don't think it's being called at all. (In particular, for normal exceptions I get a custom error page and logging... here I'm just getting the vanilla IIS 404.)

这里的 web.config中的相关位文件:

<system.web> <httpHandlers> <add verb="GET,POST" path="*.robot" validate="false" type="CSharpInDepth.Wave.RobotHandler, CSharpInDepth"/> </httpHandlers> </system.web>

(显然有在该节其他的东西太多,但我不的认为的是相关的。)

在当地,开发服务器下运行,它工作正常。在我的实际中,我总是得到网站目录本身下404一切都是相同的(通过SVN复制)。这包括包含斌目录 CSharpInDepth.dll ,我已经验证包含 CSharpInDepth。 Wave.RobotHandler 。

Locally, running under the dev server, it works fine. On my real box, I always get a 404. Everything under the web site directory itself is the same (replicated via svn). That includes the bin directory containing CSharpInDepth.dll, which I've verified contains CSharpInDepth.Wave.RobotHandler.

我尝试获取 csharpindepth/foo.robot 并只得到404

I try to fetch csharpindepth/foo.robot and just get a 404.

我试过与无集名称,具体网址或通配符的...没什么的工作。

I've tried with and without the assembly name, specific URLs or wildcarded ones... nothing's working.

我敢肯定,我只是错过了一些简单的标志某处IIS配置,但我炸飞,如果我能找到它...

I'm sure I've just missed some simple flag somewhere in the IIS configuration, but I'm blowed if I can find it...

编辑:这是IIS版本6.尝试* .robot添加到ISAPI筛选器现在......

It's IIS version 6. Attempting to add *.robot to the ISAPI filter now...

推荐答案

好吧,如果托管框IIS7在综合管线你需要将它添加到配置的其他位:

Well if the hosting box is IIS7 in integrated pipeline you need to add it into the other bit of the config:

<system.webmodules> .... <modules> <add name="RobotHandler" type="CSharpInDepth.Wave.RobotHandler, CSharpInDepth"/> </modules> .... </system.webmodules>

如果是IIS6那么你就需要为* .robots映射到ASP.NET ISAPI DLL。

If it's IIS6 then you'll need to map *.robots to the ASP.NET ISAPI DLL.

(对于非长柄水杓你做到这一点,如下所示)

(For the non-Skeets you do this as follows)

  • 打开了IIS管理。
  • 右键点击要配置网站并选择属性形成上下文菜单。这将显示Web站点属性对话框。
  • 选择主目录选项卡并单击配置按钮。这会显示的应用配置对话框。
  • 点击加。
  • 选择ASPNET_ISAPI.DLL从.NET框架的目录,你想映射的延伸和要么所有动词,或者只是那些要映射。
  • 单击确定。
  • 更多推荐

    为什么我的IHttpHandler被称为?

    本文发布于:2023-06-02 19:20:54,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/457493.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:被称为   IHttpHandler

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!