alexbeletsky / elmah-mvc

Painless integration of ELMAH into ASP.NET MVC application
http://nuget.org/packages/Elmah.MVC
Apache License 2.0
266 stars 61 forks source link

Easy way to get the /elmah route to not work when a custom route is provided. #26

Closed tdietrich513 closed 11 years ago

tdietrich513 commented 11 years ago

I've found that this works just fine.

 public static void RegisterRoutes(RouteCollection routes)
 {
        routes.IgnoreRoute("elmah");

        // rest of your route stuff goes here.
 }
alexbeletsky commented 11 years ago

@tdietrich513 please let me know, are you expecting any input here or you just share your findings? Can I close the issue?

tdietrich513 commented 11 years ago

Sharing my findings.

The wiki says:

You might change the elmah.mvc.route to a custom one, but still able to see ELMAH reports at /elmah. This issue is caused by the way how ASP.NET MVC matches controllers in separate namespaces. There are no good workaround for that (at least one I know), so if I makes a trouble to you, I recommend to reconsider the application, without using default route.

I wanted to share a good workaround for that, but I was unable to edit the wiki. You can go ahead and close the issue, but I was hoping you'd include this information on the wiki for other ELMAH + MVC users.

alexbeletsky commented 11 years ago

@tdietrich513 got it! thanks a lot for sharing that. Will put link to that issue.

chaoaretasty commented 11 years ago

Might it be possible to add the ignoreroute in bootstrap.cs if the route has been customised?

alexbeletsky commented 11 years ago

Hm, that's sounds interesting.. But don't you think it could too destructive?

chaoaretasty commented 11 years ago

Maybe have a config setting rather than automatically applying it. That way it wouldn't break if people are using both.

alexbeletsky commented 11 years ago

@chaoaretasty that makes sense to me.. would you like to consider to contribute that change?