Closed GoogleCodeExporter closed 9 years ago
Reproduced in 1.0 BETA 1a (build 1.0.8925.0) as well. The exception thrown is:
[InvalidCastException: Unable to cast object of type 'System.String' to
type 'System.Web.IHttpModule'.]
Elmah.ErrorFilterModule.Init(HttpApplication application) in
C:\Projects\Public\ELMAH\src\Elmah\ErrorFilterModule.cs:66
System.Web.HttpApplication.InitModules() +267
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState
state, MethodInfo[] handlers) +1251
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext
context) +243
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +106
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +317
Original comment by azizatif
on 3 Jul 2007 at 7:06
Fixed summary to be more accurate.
Original comment by azizatif
on 3 Jul 2007 at 7:07
This exception occurs only when trust level is high or full.
Original comment by azizatif
on 3 Jul 2007 at 7:10
The InvalidCastException was caused by returning HttpApplication.Modules
directly
under high trust. The enumerator of the returned collection
(HttpModuleCollection)
yields keys rather than IHttpModule objects, thus causing an
InvalidCastException
when the called would try to access the collection elements as IHttpModule
objects.
Original comment by azizatif
on 3 Jul 2007 at 7:24
Added new patch because the original one attached with the issue is invalid.
Original comment by azizatif
on 3 Jul 2007 at 7:37
Attachments:
Original issue reported on code.google.com by
schoenho...@gmail.com
on 2 Jul 2007 at 10:36Attachments: