However, when I try and access this user control from my staging site, I get an exception:
Unable to cast object of type 'umbraco.presentation.requestModule' to type
'umbraco.presentation.requestModuleOverride'.
My staging server is using the same line in web.config I posted above - that is, I specify umbraco.presentation.requestModuleOverride as the type for umbracoRequestModule.
If I change my user control to access the requestModule as the original type (not my overridden type), I can access it just fine.
Can anyone suggest how I might start tracking this down - why does Umbraco use my custom type on my dev machine but use the default requestModule on the staging machine, ignoring my web.config?
Custom umbracoRequestModule not being used on staging site
Hi y'all
I have a custom umbracoRequestModule, which I placed in the umbraco.presentation namespace.
I modified my web.config to use this new class:
Later, in one of my user controls, I access this overridden requestModule like so:
On my local dev machine, this works just fine.
However, when I try and access this user control from my staging site, I get an exception:
Unable to cast object of type 'umbraco.presentation.requestModule' to type 'umbraco.presentation.requestModuleOverride'.
My staging server is using the same line in web.config I posted above - that is, I specify umbraco.presentation.requestModuleOverride as the type for umbracoRequestModule.
If I change my user control to access the requestModule as the original type (not my overridden type), I can access it just fine.
Can anyone suggest how I might start tracking this down - why does Umbraco use my custom type on my dev machine but use the default requestModule on the staging machine, ignoring my web.config?
OK, well, of course right after posting this I figured it out! (after being stuck on this for ages! doh!)
So it turns out web.config defines these modules twice - I didn't look far enough down :p
Can anyone explain what this bit does? (why it removes the httpModule then re-adds it?)
And why this only seems to happen on my staging site, not my local site? (my local web.config also has this remove > add bit as well...)
Edit: OK, so after a bit of a google, system.web is for IIS6, and system.webServer is IIS7 - this makes sense!
is working on a reply...