HttpHandler in IIS7 and Visual Studio 2010

2019-07-07 10:14发布

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条回答
狗以群分
2楼-- · 2019-07-07 10:36

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

查看更多
登录 后发表回答