I installed ELMAH.MVC nuget package and it's logging my ASP.NET MVC errors. However when I go to http://www.example.com/en-us/elmah the page is not styled and the below error is shown:
A public action method 'stylesheet' was not found on controller 'Elmah.Mvc.ElmahController'.
I have the following Routes:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("content/{*pathInfo}");
routes.IgnoreRoute("favicon.ico");
routes.MapRoute(
name: "users",
url: "{culture}/users/{userUrl}",
defaults: new
{
controller = "AccountProfile",
action = "Index",
culture = ""
}
);
routes.MapRoute(
name: "SpecificCulture",
url: "{culture}/{controller}/{action}/{id}",
defaults: new
{
controller = "Home",
action = "Index",
id = UrlParameter.Optional,
culture = ""
}
);
}
My web.config appSettings
:
<appSettings>
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="webpages:Version" value="2.0.0.0" />
<add key="PreserveLoginUrl" value="true" />
<add key="BaseAddress" value="http://localhost:3453/" />
<add key="MailActive" value="true" />
<add key="aspnet:UseHostHeaderForRequestUrl" value="true" />
<add key="elmah.mvc.disableHandler" value="false" />
<add key="elmah.mvc.disableHandleErrorFilter" value="false" />
<add key="elmah.mvc.requiresAuthentication" value="true" />
<add key="elmah.mvc.IgnoreDefaultRoute" value="false" />
<add key="elmah.mvc.allowedRoles" value="Administrator" />
<add key="elmah.mvc.allowedUsers" value="*" />
<add key="elmah.mvc.route" value="elmah" />
</appSettings>
I believe the issue is on my routes, but sincerely I have no clue what to do about it.
Any help would be great
EDIT :
As sugested by Steve Newton I added the following route:
routes.MapRoute(
name: "elmah",
url: "{controller}/elmah",
defaults: new
{
controller = "elmah",
action = "Index",
}
);
Thanks