Click here to Skip to main content
15,846,091 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi,

I have httphandler which is an entry point for all .net apps on the server. The destination webapplication path has some sub/virtual path directories.

e.g destination web app location is sw/entry. Other .net applications are also deployed in following location: sw/abc/app.

Because the handler application is root directory, the sub application are inheriting verbs (via add verb) and are trying to load the handler dll. I would like to avoid some of the applications which are located in sub directories to NOT load the handler dll.

I found out that I need to remove verb in the web.config handler section from the sub application.

I don't know the syntax of this. If someone can help me out.

Here is the add verb in the handler webapp:
<add verb="*" path="*.*" type="com.s.w.e.DomainHandler,com.s.w.e" />

I tried adding remove verb in the handler webapp as well as sub application's web.config directly. None of them work.

Here is the syntax:
<remove verb="*" path="*/sw/abc/*.aspx"/>

fyi: Handler is not looking for any specific file type. It is doing custom url redirecting.

I am using .net 2.0 webapplication
Posted
Updated 1-Feb-11 8:15am
v2

hi,

you can see the ref here
http://msdn.microsoft.com/en-us/library/e0dzxdza.aspx[^]
under all your sub virtual directory web.config you can add this
XML
<httpHandlers>
       <remove verb="*" path="*"/>
    </httpHandlers>


this should do the trick.
 
Share this answer
 
Comments
Henry Minute 1-Feb-11 15:43pm    
The OP has responded to your answer. It is currently marked as Answer 2.
bemahesh 1-Feb-11 15:49pm    
In the sub folder application, I have some handlers that I need to keep:
for example,
Collapse
<remove verb="*" path="*.asmx">
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
You mentioned to remove using syntax: <remove verb="*" path="*">
If I add remove in this sub application, wouldn't it remove other handlers(mentioned above) as well?
In the sub folder application, I have some handlers that I need to keep:
for example,
MSIL
<remove verb="*" path="*.asmx"/>
     <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
     <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
     <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>


You mentioned to remove using syntax: <remove verb="*" path="*"/>
If I add remove in this sub application, wouldn't it remove other handlers(mentioned above) as well?
 
Share this answer
 
Comments
Henry Minute 1-Feb-11 15:42pm    
You should respond to an answerer by adding a comment to their answer, NOT by adding an answer. If you do that they will get an Email notification that you have responded. The way you have done it no-one gets notified and they will only see your response if they come back to look at your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900