HttpHandler not being cleared

G

Guest

In the root of my ASP.NET app I've a web.config which includes these lines:
<code
[1

<httpHandlers><add verb="*" path="GetImage.ashx" type="StatsAndMaps.Map.GetImage, StatsAndMaps" /></httpHandlers></code

In a sub-folder where I don't care about this I've another web.config which includes these lines:
<code
[2

<httpHandlers><clear /></httpHandlers></code
But, when I run the app and access a page in the sub-folder [2], I'm getting a "File or assembly name StatsAndMaps, or one of its dependencies, was not found" error with the contents of [1] highlighted. I expected [1] to be ignored, so what's happening?

Any ideas, anyone?
 
M

Martin Dechev

Hi, gingerbbm,

Firts, for the web.config in the subdirectory to be taken in consideration
the subdirectory should be configured to be an application (in the IIS).

Now, to remove the handlers in, let's say, subfolder sub1 add the following
to the web.config (the one in the root of the application):

<location path="sub1">
<system.web>
<httpHandlers>
<clear />
</httpHandlers>
</system.web>
</location>

Hope this helps
Martin
gingerbbm said:
In the root of my ASP.NET app I've a web.config which includes these lines:
<code>
[1]

<httpHandlers><add verb="*" path="GetImage.ashx"
type="StatsAndMaps.Map.GetImage said:
In a sub-folder where I don't care about this I've another web.config which includes these lines:
<code>
[2]

<httpHandlers><clear /></httpHandlers></code>
But, when I run the app and access a page in the sub-folder [2], I'm
getting a "File or assembly name StatsAndMaps, or one of its dependencies,
was not found" error with the contents of [1] highlighted. I expected [1] to
be ignored, so what's happening?
 
G

Guest

Thanks for responding, Martin.

The subfolder is defined as an app in IIS. I had tried putting the <clear/> into the web.config in the subfolder but to no avail, so I tried it the way you suggested, by packaging it up in a <location> element in the root web.config. Unfortunately that doesn't do it either.

Do the "default" settings in the root web.config have to be in a <location> element too?

I found this on Google Groups... can you verify?
http://groups.google.com/groups?hl=...F-8&oe=UTF-8&q=httphandlers+clear&sa=N&tab=wg

Any further help is greatly appreciated... it can't be this difficult!

Cheers
Stu
 
M

Martin Dechev

Hi, Stu,

I could not find a KB article to confirm what was stated in the reply in
google. But if it is true you don't have many options other than:
1. Set the handler for an application that doesn't have subroots.
2. Copy the dll to the bin folder(s) of the subroot application(s).

Another thing to try that comes to my mind is to set the validate attribute
in the <add> tag to false. But in this case I don't know what will happen if
there comes a request that should go to the handler in the subdirectory.

Greetings
Martin
gingberbbm said:
Thanks for responding, Martin.

The subfolder is defined as an app in IIS. I had tried putting the
<clear/> into the web.config in the subfolder but to no avail, so I tried it
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top