views:

29

answers:

1

Hello, 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?

A: 

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

Nicholas Piasecki
Thanks for the answer.Classic asp.net site, no MVC, no Routing.In the web.config file I havve this:<system.webServer> <validation validateIntegratedModeConfiguration="false" /><handlers> <add name="myAshx" path="myAshx.ashx" verb="GET" type="myAshx" resourceType="Unspecified" preCondition="integratedMode" /></handlers>
opaera
Try adding an appropriate httpHandler under the old <system.web><httpHandlers> section. Cassini predates IIS7, I doubt that they updated it to look in the IIS7 <system.webServer> section. Could be wrong on this, though, but worth a shot.
Nicholas Piasecki
It works!! Thanks. Just a question, when I deploy it, I don't need the section in the System.Web right ?
opaera
Nicholas Piasecki