HttpHandler in IIS7 and Visual Studio 2010

2019-07-07 09:43发布

问题:

I'm trying to run an httphandler (ashx) in a asp.net 4 website.

When I call it from Visual Studio integrated server, it returns a 404 error.

It works if I call it on the site configured into the local IIS.

Someone could help?

回答1:

Are you using ASP.NET MVC, or System.Web.Routing?

Do you have something like

routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");

in your RegisterRoutes() function in your HttpApplication instance?

One thing to keep in mind is that the Visual Studio server thingie runs all requests through the managed pipeline.

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.)