Httpmodules, Sub-Applications and Clear

  • Thread starter Thread starter Markus Kling
  • Start date Start date
M

Markus Kling

Hi,

I have a web application that has two sub-applications. The root application
defines two httpModules which shall not be loaded for the subapplications. I
tried to achieve this by adding

<httpmodules>
<clear />
</httpmodules>

within the web.config file of the sub-applications.

My problem is that the compiler stil tries to load the referenced assemblies
and states them (correctly) as missing.

What did I miss?

Thanks
Markus
 
<clear /> removes HttpModule mappings from an application.

<remove name=...> removes the HttpModule class from an application.

<httpModules>
<add type="classname,assemblyname" name="modulename"/>
<remove name="modulename"/>
<clear/>
</httpModules>




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 
Hi Juan,

that's exactly what I did!!

wwwroot\web.config
....
<httpModules>
<add type="NK.Utils.LogInitializer,NK.Utils" name="LogInitializer" />
<add type="awisto.Web.UrlRewrite.HttpModule,awisto.Web.UrlRewrite"
name="UrlRewrite" />
</httpModules>
...

wwwroot\subapp\web.config
....
<httpmodules>
<clear />
</httpmodules>
....

This results in a Pre-bin failure for the NK.Utils dll within the
"wwwroot\subapp" application. That's correct since the DLL is not in the
wwwroot\subapp\bin directory.

My question was why it is not removed!!

Thanks again,
Markus
 
Hi, Mark.

OK, from your post it wasn't clear whether you were removing
the modules by using <remove name="LogInitializer"/> and
<remove name="UrlRewrite"/> since you only included <clear />
in your reply.

If that's the case, I'd bug it at the Feedback Center :

http://lab.msdn.microsoft.com/productfeedback/

You'll need a Passport account to be able to file bug reports there.




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 
Just to be clear. The issues are for .Net 1.2. Haven't crosschecked with
..Net 2.0 runtime.

Markus
 
<remove...> works the same way in 1.1.

See :
http://msdn.microsoft.com/library/d...s/cpgenref/html/gngrfremoveforhttpmodules.asp
and
http://msdn.microsoft.com/library/d...-us/cpgenref/html/gngrfhttpmodulessection.asp
for 1.1

and
http://msdn2.microsoft.com/en-us/library/81b3ekbd.aspx
for 2.0

The only caveat is that the value of <remove>
must exactly match that of a previous <add> directive.



Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 

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

Back
Top