简体   繁体   English

我的HttpHandler不适用于IIS7中的虚拟目录,但是使用cassini可以吗?

[英]My HttpHandler doesn't work with a virtual directory in IIS7, but using cassini it does?

My httphandler does not work in IIS7 (virutal directory), but using cassini it works. 我的httphandler在IIS7(虚拟目录)中不起作用,但是使用卡西尼它可以工作。

It used to work on my windows xp IIS also. 它曾经也可以在我的Windows XP IIS上工作。

What could be the cause of this? 这可能是什么原因?

I am getting a 404 not found error when trying to access the httphandler's page. 尝试访问httphandler的页面时出现404 not found错误。

IIS7 depends on the registration for HttpHandlers to be in a different location than usual. IIS7依赖于HttpHandlers的注册位置与通常的位置不同。 There is a section in system.web/webserver/handlers where you should be able to register your HttpHandler, as opposed to the standard system.web/httpHandlers 与标准system.web / httpHandlers相对,system.web / webserver / handlers中有一个部分应可以注册HttpHandler。

Hope that helps 希望能有所帮助

检查网络服务(或其应用程序池运行所在的身份)是否具有对.ashx文件的读取访问权限。

I have the same problem. 我也有同样的问题。 I have an axd file registered in the web.config file. 我在web.config文件中注册了一个axd文件。 The site renders fine in all conditions, the only thing that doesn't work is the axd reference. 该网站在所有情况下都可以正常显示,唯一不起作用的是axd参考。

Using the asp.net development server (cassini) everything works perfectly. 使用asp.net开发服务器(cassini),一切运行正常。

http : / / localhost:5059 <-- works fine http:// localhost:5059 <-工作正常

But if I use the IIS instance on the machine, and a properly created virtual directory on my machine... 但是,如果我在计算机上使用IIS实例,并在计算机上使用正确创建的虚拟目录,则...

http : / / localhost/appName <-- Doesn't Work. http:// // localhost / appName <-不起作用。

Site renders but calls to the axf fail (404). 网站渲染,但对axf的调用失败(404)。 So it isn't an improperly registered handler, a permissions issue, or a mis-spelled URL. 因此,它不是注册不当的处理程序,权限问题或URL拼写错误。

Additionally, if I deploy it to a server under a domain name, as a virtual directory, it works there too. 另外,如果我将其作为虚拟目录部署到域名下的服务器上,那么它也可以在其中工作。

http : / / www.adomainname.com/appname <-- works fine http://www.adomainname.com/appname <-正常工作

The only issue is developing using IIS rather than Cassini. 唯一的问题是使用IIS而不是Cassini进行开发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM