IIS7和Visual Studio 2010中的HttpHandler [英] HttpHandler in IIS7 and Visual Studio 2010
问题描述
我正在尝试在asp.net 4网站中运行httphandler(ashx).
I'm trying to run an httphandler (ashx) in a asp.net 4 website.
当我从Visual Studio集成服务器调用它时,它返回404错误.
When I call it from Visual Studio integrated server, it returns a 404 error.
如果我在配置为本地IIS的站点上调用它,它将起作用.
It works if I call it on the site configured into the local IIS.
有人可以帮忙吗?
推荐答案
您是否正在使用ASP.NET MVC或System.Web.Routing?
Are you using ASP.NET MVC, or System.Web.Routing?
你有类似
routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");
在HttpApplication
实例的RegisterRoutes()
函数中是
?
in your RegisterRoutes()
function in your HttpApplication
instance?
要记住的一件事是,Visual Studio服务器事件通过托管管道运行所有请求.
One thing to keep in mind is that the Visual Studio server thingie runs all requests through the managed pipeline.
httpHandler
是否已添加到Web.config
文件的system.web
部分中? (在IIS7中,该代码位于system.webServer
部分下,但我不确定是否可以在其中找到更新版本的Cassini.)
Is the httpHandler
added to the system.web
section of the Web.config
file? (In IIS7, this goes under the system.webServer
section, but I am not sure if newer versions of Cassini will look there.)
这篇关于IIS7和Visual Studio 2010中的HttpHandler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!