verbs for custom http handler work only on dev machine?

P

PJ6

I have this little tidbit in system.web in my web.config file, to allow
the handling of requests ending in ".res":

<httpHandlers>
<remove verb="*" path="*.res"/>
<add verb="*" path="*.res" type="DEVTEST.Resources+HttpHandler"
validate="false"/>
</httpHandlers>

This works fine on my development machine, but when I put the project on
another box for testing ".res" requests are ignored completely (404). I
poked around in the Home Directory configuration in IIS, and it appears I
need to add the extention to Mappings... I went ahead and manually
specified the dll in the bin directory of the project and now get a 403,
access denied.

How do I get this to work? And why do I have to specify handler information
twice, once in the web.config, and on deployment, apparently also in another
place?

Paul
 
J

Juan T. Llibre

re:
!> I have this little tidbit in system.web in my web.config file,
!> to allow the handling of requests ending in ".res":

Why go to that much trouble ?

You can pipe any extension to aspnet_isapi.dll without a new HttpHandler.

1. Register your custom handler in web.config and map it to the *existing* ASPX handler :

<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.res" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
</system.web>
</configuration>

2. If using ASP.NET 2.0, you'll also need to add :

<compilation>
<buildProviders>
<add extension=".res" appliesTo="Web" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>

....and map the extension .res to aspnet_isapi.dll in your Application's
"Configuration" section in the "Virtual Directory" tab of the IIS MMC.

As soon as you do that, your app will process *.res files just as if they were *.aspx files.
 
P

PJ6

Maybe I wan't clear in my post, but I don't want to process *.res as if they
were *.aspx files. I am serving embedded resources from my own handler.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top