IIS7和Visual Studio 2010中的HttpHandler [英] HttpHandler in IIS7 and Visual Studio 2010

查看:89
本文介绍了IIS7和Visual Studio 2010中的HttpHandler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆