elmah-mvc icon indicating copy to clipboard operation
elmah-mvc copied to clipboard

IgnoreDefaultRoute doesn't seem to have any effect

Open bborad opened this issue 8 years ago • 6 comments

Hi

I have am mvc + web api application in vs 2015. I have installed elmah.mvc and elmah.contrib.webapi packages and everything seem to be working fine with default settings.

Now I want to change the default /elmah url to admin/diagnostic/elmah (with admin only access authorisation ). I have set elmah.mvc.requiresAuthentication to true and elma.mvc.route to new route but it does not seem to have changed anything. I can still access the /elmah and nothing at new route (/admin/diagnostic/elmah).

Can anybody please let me know if I am missing anything or doing anything wrong?

Thanks

bborad avatar Sep 22 '16 03:09 bborad

I am also having this issue and wasn't sure if I was just doing something wrong. Did you find a solution?

sfhaney avatar Apr 03 '17 18:04 sfhaney

not yet

bborad avatar Apr 20 '17 02:04 bborad

Amazingly it's still the same. Just installed the latest version () and specifying a custom route has no effect at all having set elmah.mvc.IgnoreDefaultRoute to true.

I'm surprised. I would have thought being able to do this would be a major requirement for anyone using this great package

JohnMcAvinue avatar Sep 14 '17 23:09 JohnMcAvinue

I'll take a look asap. I could reproduce the issue, but did not find a cause yet.

peterdew avatar Oct 19 '17 14:10 peterdew

Thanks a lot @peterdew

alexbeletsky avatar Oct 20 '17 09:10 alexbeletsky

(correction: Didn't reproduce the issue, only made another configuration mistake with same results.)

@bborad I made the same changes as you in my config and I had no problems. The Controller is still named 'Elmah' though, with action 'Index' So when I use this actionlink-helper in my view:

@Html.ActionLink("Logging", "Index", "Elmah")

this wil render to

<a href="/admin/diagnostic/elmah">Logging</a>

Can you please try that with the requiresAuthentication set to false first? Also, why did you install elmah.contrib.webapi, since I don't need it. elmah.corelibrary and Elmah.Mvc suffice

peterdew avatar Oct 24 '17 14:10 peterdew