Note that there are some explanatory texts on larger screens.

plurals
  1. POHttpModule doesn't seem to work
    text
    copied!<p>I've created a simple HttpModule to log the uses of my existing webservice. There's a dll containing a single class </p> <pre><code>public class TrackingModule : System.Web.IHttpModule { public TrackingModule(){} public void Init(System.Web.HttpApplication context) { context.BeginRequest+=new EventHandler(context_BeginRequest); } public void Dispose() { } private void context_BeginRequest(object sender, EventArgs e) { try { Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish( new Exception("Log attept") ); HttpApplication app = (HttpApplication)sender; string method = app.Request.RawUrl; SaveUseToDatabase( app.Request.UserHostAddress, method ); } catch( Exception ex ) { try { Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish( ex ); } catch{} } } } </code></pre> <p>After compiling the dll I add it to webservice's bin folder and in webservice's web.config I add:</p> <pre><code>&lt;system.web&gt; &lt;httpModules&gt; &lt;add name="TrackingModule" type="WebserviceTrackingModule.TrackingModule, WebserviceTrackingModule"/&gt; </code></pre> <p>This works fine on my computer, but when I copy it to production server, nothing happens. No new entries in database, no entries logged by ExceptionManager. As if it's not there at all.</p> <p>What can I be missing?</p> <p>Edit: After performing another test I can add that it works when I add it for a webservice that has it's own top-level virtual directory. It doesn't work for webservices that reside in virtual directories that are subfolders of another virtual directory.</p> <p>I know that HttpModules settings are being inherited by subdirectories, but it looks like the existence of parent directory gets in the way.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload