Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ELMAH: Elmah pages not styled making them difficult to read

Setup:

I have ELMAH installed via NuGet on an ASP.NET MVC 4 site.

On the dev machine the app is installed at the root. It all works and is styled as ELMAH pages usually are. It always does that, work on the dev machine I mean, doesn't it?

But on the server, the app installed in a sub folder (~/tracker). Although ELMAH works fine, the pages are unstyled, making them difficult to read.

Question:

What do I need to do to get the pages to style?

Presumably, the styling comes from a resource that can be configured in the web.config. But how?

Edit:

I have found that I am getting a highly relevant error:

System.Web.HttpException: A public action method 'stylesheet' was not found on controller 'Elmah.Mvc.ElmahController'.

The path is given as:

/tracker/elmah/stylesheet

This is obviously related to the Link tag in the source of the ELMAH pages:

<link rel="stylesheet" type="text/css" href="/tracker/elmah/stylesheet" />

But how do I configure this url?

like image 376
awrigley Avatar asked Feb 14 '13 13:02

awrigley


1 Answers

What is your "elmah.mvc.route" setting? Can you see the elmah screen if you remove "/tracker" from your path?

Out of the box, elmah's route setting is:

<add key="elmah.mvc.route" value="elmah" />

Yours needs to be

<add key="elmah.mvc.route" value="tracker/elmah" />

Your route configuration is correctly redirecting requests for controller actions, but elmah prints the stylesheet address itself without using your route config, so you'll need to tell it what route/URL to use for its references.

like image 136
davidmdem Avatar answered Oct 27 '22 07:10

davidmdem