getting File or directory not found for elmah.axd

358 views
Skip to first unread message

wrighty

unread,
May 1, 2009, 3:29:23 AM5/1/09
to ELMAH
HI

I have added ELMAH to a test site which is a sub domain - I have
followed all the instructions but when I try to navigate to elmah.axd
I get:

404 - File or directory not found.
The resource you are looking for might have been removed, had its name
changed, or is temporarily unavailable.

It all worked locally - so I am wondering if it is because I have put
this in a sub domain. Any ideas??

thanks


Atif Aziz

unread,
May 1, 2009, 5:54:33 PM5/1/09
to el...@googlegroups.com
so I am wondering if it is because I have put
this in a sub domain.  Any ideas??

So far, no one has ever reported any issues with running ELMAH in a sub-domain. There shouldn't be any special requirement for doing so. I suspect that it's a configuration (either an IIS or web.config) issue.

wrighty

unread,
May 1, 2009, 8:05:38 PM5/1/09
to ELMAH
Thanks - I have tried playing around with the web.config - and now get
a 403 - Forbidden: Access is denied

Not sure if I have something wrong in my web.comfig or something on
IIS - can someone just confirm my web.config is correct?

My site is hosted on IIS6 - so in my web.config I have:

<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
<remove name="ScriptModule"/>
<remove name="UrlRoutingModule"/>
<add name="ScriptModule" preCondition="managedHandler"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingModule"
type="System.Web.Routing.UrlRoutingModule, System.Web.Routing,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="Elmah.ErrorLog" type="Elmah.ErrorLogModule,
Elmah" preCondition="managedHandler" />
<add name="Elmah.ErrorFilter"
type="Elmah.ErrorFilterModule" preCondition="managedHandler" />
<add name="Elmah.ErrorMail" type="Elmah.ErrorMailModule"
preCondition="managedHandler" />

</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<remove name="MvcHttpHandler"/>
<remove name="UrlRoutingHandler"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*"
path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode"
verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add name="MvcHttpHandler" preCondition="integratedMode"
verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler,
System.Web.Mvc, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingHandler"
preCondition="integratedMode" verb="*" path="UrlRouting.axd"
type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD"
type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" /
>
</handlers>
</system.webServer>


Thanks
> > thanks- Hide quoted text -
>
> - Show quoted text -

wrighty

unread,
May 1, 2009, 8:40:47 PM5/1/09
to ELMAH
woops - that was for iis7, my config has the following:

<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add verb="*" path="*.mvc" validate="false"
type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="POST,GET,HEAD" path="elmah.axd"
type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<httpModules>
<add name="ScriptModule"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingModule"
type="System.Web.Routing.UrlRoutingModule, System.Web.Routing,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="FixIIS5xWildcardMapping"
type="Elmah.FixIIS5xWildcardMappingModule, Elmah"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/
>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule,
Elmah"/>
</httpModules>
> > - Show quoted text -- Hide quoted text -

James_2JS

unread,
May 2, 2009, 10:29:50 AM5/2/09
to ELMAH

wrighty

unread,
May 3, 2009, 2:27:39 AM5/3/09
to ELMAH
Yeah it is MVC, I have got the errors logging in SQL server ok, but
just get the error when trying to view the axd file.



On May 3, 12:29 am, James_2JS <jamesdrisc...@btinternet.com> wrote:
> Hi there!
>
> Looks like an ELMAH + MVC issue.
> Take a look at these posts and see if they help!
>
> http://www.hanselman.com/blog/ELMAHErrorLoggingModulesAndHandlersForA...http://danswatik.com/index.php/2009/04/23/how-to-get-elmah-to-work-wi...

Atif Aziz

unread,
May 3, 2009, 10:29:32 AM5/3/09
to el...@googlegroups.com
Yeah it is MVC, I have got the errors logging in SQL server ok, but
just get the error when trying to view the axd file.

In that case, have you tried adding the following to your routes collection?

routes.IgnoreRoute("elmah.axd");

The trouble is, you need to bypass MVC routing for the path registered for ELMAH. See here for more:
http://www.tigraine.at/2009/04/20/elmah-aspnet-error-logging-on-mvc/

wrighty

unread,
May 4, 2009, 4:49:49 AM5/4/09
to ELMAH
Yeah thanks - I have that in the global.asax

I tried changing the elmah.axd to elmah.aspx in the web config, added
elmah.aspx to ignore route in the global.

Still does not work - it works fine locally just not in the test sub
domain of the live site.

S

On May 4, 12:29 am, Atif Aziz <aziza...@gmail.com> wrote:
> > Yeah it is MVC, I have got the errors logging in SQL server ok, but
> > just get the error when trying to view the axd file.
>
> In that case, have you tried adding the following to your routes collection?
>
> routes.IgnoreRoute("elmah.axd");
>
>
>
> The trouble is, you need to bypass MVC routing for the path registered for
> ELMAH. See here for more:http://www.tigraine.at/2009/04/20/elmah-aspnet-error-logging-on-mvc/
>
>
>
> On Sun, May 3, 2009 at 8:27 AM, wrighty <sara.wri...@gmail.com> wrote:
>
> > Yeah it is MVC, I have got the errors logging in SQL server ok, but
> > just get the error when trying to view the axd file.
>
> > On May 3, 12:29 am, James_2JS <jamesdrisc...@btinternet.com> wrote:
> > > Hi there!
>
> > > Looks like an ELMAH + MVC issue.
> > > Take a look at these posts and see if they help!
>
> >http://www.hanselman.com/blog/ELMAHErrorLoggingModulesAndHandlersForA....
> > ..

wrighty

unread,
May 4, 2009, 7:27:07 PM5/4/09
to ELMAH
Finally got it working - had to add

<security allowRemoteAccess="1" />

to the elmah section.

phew.

thanks

S
Reply all
Reply to author
Forward
0 new messages