HttpModule Catch-22

Thursday, January 8, 2004 by scott

I have the .Text engine running in an application underneath the ASP.NET Community Starter Kit. This required a bit of fiddling, because the CSK installs an HttpModule at the application root. When a request goes to the Blogs directory (.Text), the ASP.NET runtime doesn't find the CSK module in the .Text /bin directory and throws an exception (the assembly is in the CSK /bin directory - one level higher).

I thought this would be easy to fix with a tweak in the <httpModules> section of the .Text web.config:

    <remove name=“CommunitiesModule“ />

However, I was still getting an exception. After some google searches I determined the workaround is to place the assembly with the HttpModule into the /bin directory of the application which doesn't use the assembly in order for it to then be removed with the above entry.

This makes sense in a Joseph Heller sort of way....

There was only one catch and that was Catch-22, which specified that a concern for one's safety in the face of dangers that were real and immediate was the process of a rational mind. Orr was crazy and could be grounded. All he had to do was ask; and as soon as he did, he would no longer be crazy and would have to fly more missions. Orr would be crazy to fly more missions and sane if he didn't, but if he was sane he had to fly them. If he flew them he was crazy and didn't have to; but if he didn't want to he was sane and had to. Yossarian was moved very deeply by the absolute simplicity of this clause of Catch-22 and let out a respectful whistle.
"That's some catch, that Catch-22," he observed.
"It's the best there is," Doc Daneeka agreed. 

My Pluralsight Courses

K.Scott Allen OdeToCode by K. Scott Allen
What JavaScript Developers Should Know About ECMAScript 2015
The Podcast!