我试图让一个自定义的处理程序,以对特定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)
更多推荐
为什么我的IHttpHandler被称为?
发布评论