You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that the Elmah Exception Page does not work properly while running under an IIS sub application.
Assume running an app under IIS and the "/" application is not running MVC. But an mvc6 application is deployed to "/mvc6". Using the default options for Services.AddElmah() and app.UseElmahExceptionPage() works fine while accessing the error page (i.e. "/mvc/elmah"). But, when an exception occurs, the redirect url is "/elmah/detail/{guid}", which is to the root application.
Updating the ElmahOptions.Path to various values does not resolve the issue.
"elmah"
Same behavior as not setting
Elmah error page works at "/mvc6/elmah"
Elmah redirect is to "/elmah/detail/{guid}" and is a 404
If I modify the error redirect to "/mvc6/elmah/detail/{guid}", the error page displays
The detail page incorrectly updates the URL. If the exception occured on "/mvc6/controller/action", the url becomes "/controller/action". (This appears to be a .pushState() and not a redirect.)
"~/elmah"
Elmah error page does not work
Elmah redirect is to ~/elmah/detail/{guid} (the ~ is not translated)
"/mvc6/elmah"
Elmah error page works at /mvc6/mvc6/elmah
Elmah redirect is to /mvc6/elmah/detail/{guid} and is a 404
A possible fix is to modify ErrorLogMiddleware.InvokeAsync(HttpContext context) to and replace "~/" with HttpContext.Request.PathBase.
The text was updated successfully, but these errors were encountered:
It appears that the Elmah Exception Page does not work properly while running under an IIS sub application.
Assume running an app under IIS and the "/" application is not running MVC. But an mvc6 application is deployed to "/mvc6". Using the default options for
Services.AddElmah()
andapp.UseElmahExceptionPage()
works fine while accessing the error page (i.e. "/mvc/elmah"). But, when an exception occurs, the redirect url is "/elmah/detail/{guid}", which is to the root application.Updating the ElmahOptions.Path to various values does not resolve the issue.
"elmah"
Same behavior as not setting
Elmah error page works at "/mvc6/elmah"
Elmah redirect is to "/elmah/detail/{guid}" and is a 404
If I modify the error redirect to "/mvc6/elmah/detail/{guid}", the error page displays
The detail page incorrectly updates the URL. If the exception occured on "/mvc6/controller/action", the url becomes "/controller/action". (This appears to be a
.pushState()
and not a redirect.)"~/elmah"
Elmah error page does not work
Elmah redirect is to
~/elmah/detail/{guid}
(the ~ is not translated)"/mvc6/elmah"
Elmah error page works at
/mvc6/mvc6/elmah
Elmah redirect is to
/mvc6/elmah/detail/{guid}
and is a 404A possible fix is to modify
ErrorLogMiddleware.InvokeAsync(HttpContext context)
to and replace "~/" withHttpContext.Request.PathBase
.The text was updated successfully, but these errors were encountered: