I'm trying to access /elmah.axd in my broswer, but it returns:
{"message":"No HTTP resource was found that matches the request URI 'http://services.domain.com/elmah.axd'."}
The server is local (127.0.0.1) and even on that I have my web.config Elmah settings to secure it this way:
<elmah>
<security allowRemoteAccess="true" />
</elmah>
My WebApiConfig looks like:
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
// Locally only you will be able to see the exception errors
config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.LocalOnly;
// Web API routes
config.Routes.IgnoreRoute("elmah", "elmah.axd");
config.Routes.IgnoreRoute("allemah", "elmah.axd/{*pathInfo}");
config.Routes.IgnoreRoute("elmahgeneric", "{resource}.axd/{*everything}");
config.MapHttpAttributeRoutes();
var jsonFormatter = config.Formatters.OfType<JsonMediaTypeFormatter>().First();
jsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
// Remove the XML formatter
config.Formatters.Remove(config.Formatters.XmlFormatter);
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
I even tried ignoring only one route at the time from any of the 3 combinations and no luck.
finally my global.asax looks like this:
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
}
Any hint or idea of what I could be missing, would be good.
Thanks in advance, really appreciate your time looking into this.
I finally made it.
By adding to the WebApiConfig.cs file
The entire code of the WebApiConfig.cs file looks like this:
And the final change is add this to the global.asax under application_start method
Special thanks all who helped me with this issue.