简体   繁体   中英

Error adding elmah modules to system.webserver

I have a web site hosted in Azure App Services that has three virtual applications underneath. All three virtual applications have Elmah referenced. One of the virtual applications, which has it's path set to '/', has an issue when I add the elmah modules in under the <system.webServer> tag:

<modules runAllManagedModulesForAllRequests="true">
  <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
  <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
  <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
  <remove name="StackifyHttpModule_Net40" />
  <add name="StackifyHttpModule_Net40" type="StackifyHttpTracer.StackifyHttpModule,StackifyHttpTracer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=93c44ce23f2048dd" preCondition="managedHandler,runtimeVersionv4.0" />
 </modules>

If I remove the three elmah modules, the site works fine, if I have them in there, all parts of the site die with a white screen and the message:

The page cannot be displayed because an internal server error has occurred.

If I add in the <httpErrors existingResponse="PassThrough"> tag, I get just a white screen. Nothing is showing up in the event logs.

I also tried removing the modules before adding them (like the stackify one) but still no use.

Can someone give me an idea of how to trouble shoot this or what is going on?

Thanks!

Ok, so immediately after posting I tried one other thing, in all virtual applications I added:

<remove name="ErrorLog" />
<remove name="ErrorMail" />
<remove name="ErrorFilter" />

before the modules were added in and everything worked. I guess the root virtual application added in the modules and the sub path virtual application tried to add them in again and that caused the error.

This only seems to happen in the <system.webServer> modules not the <system.web> httpModules which I guess makes sense since webServer would be a server level thing and web would just be for the specific virtual application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM